Time and various CPU times

Source: Internet
Author: User

Computing Using Time FunctionsProgramDuring the running time, there were three times, which were not too clear. Many people's blogs were not too clear. Here we will repeat them:

I. instance:

 
Time CP ~ /Downloads/archlinux-2012.03.10_04-00-01-core-i686.iso.
 
Real 0m4. 749 s
User 0m0. 008 s
Sys 0m0. 656 s

 

Ii. Because UNIX is a multi-task time-sharing operating system, there are many time types, which generally include the following concepts:
1. Response Time:The most intuitive definition is the time it takes for a computer to complete a task, including disk access, memory access, input/output, other tasks, and operating system overhead. (What is the actual time from running the program to program completion ?? Real)

2.CPU time:CPUWorking time, not includingI/OWait time and the time when other programs run. (The response time you see is the total time spent by the program to complete the task, insteadCPUTime.)

3.User CPU time:TheCPUTime. (Execute each lineCodeTime ?? User)

4.System CPU time:The operating system cost during the user's program runningCPUTime. (System Call, read, write,How long does it take to execute the service in the inner core ?? Sys)

 

Iii. Relationship

1. User CPU time + system CPU time = CPU time

2. Actual time (real)> CPU time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.