gogoWebsite

Understand Elapsed Time, CPU Time, Wait Time

Updated to 6 days ago

Elapsed Time

Elapsed Time indicates the duration of the program running.

CPU Time

CPU Time is the processor time taken by the process.
For a single-threaded program, CPU Time refers to the total amount of time the thread spends on a logical processor.
For multithreaded programs, CPU Time refers to the sum of time spent by all threads on the processor.

User CPU Time

User CPU Time refers to the time used by a process to execute user-state code, which is the actual CPU time consumed by executing this process.

System CPU Time

System CPU Time refers to the CPU time consumed by a process in the kernel state, that is, the CPU time used to execute system calls in the kernel.

Wait Time

Wait Time is the total time the CPU spends waiting for I/O operations.

The relationship between Elapsed Time, CPU Time, Wait Time

In the case of single-core processors, Elapsed Time = Cpu Time + Wait Time.
In the case of multi-core processors, since multiple CPUs are processing tasks simultaneously, the CPU Time may be larger than the Elapsed Time.