Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User CPU time vs System CPU time?

Tags:

cpu

Could you explain more about "user CPU time" and "system CPU time"? I have read a lot, but I couldn't understand it well.

like image 686
user472221 Avatar asked Nov 30 '10 02:11

user472221


People also ask

What is the difference between user CPU time and system CPU time?

User time is the amount of time the CPU was busy executing code in user space. System time is the amount of time the CPU was busy executing code in kernel space.

What is user time and system time?

'user' time is the CPU time spent in user-mode code (outside the kernel). 'Sys' time is the amount of CPU time spent in the kernel. This means executing CPU time spent in system calls within the kernel, as opposed to library code, which is still running in user-space.

What is CPU time in operating system?

CPU time (or processing time) is the amount of time for which a central processing unit (CPU) was used for processing instructions of a computer program or operating system, as opposed to elapsed time, which includes for example, waiting for input/output (I/O) operations or entering low-power (idle) mode.

Is CPU time the same as execution time?

CPU time is a true measure of processor/memory performance. CPU time (or CPU Execution time) is the time between the start and the end of execution of a given program.


2 Answers

The difference is whether the time is spent in user space or kernel space. User CPU time is time spent on the processor running your program's code (or code in libraries); system CPU time is the time spent running code in the operating system kernel on behalf of your program.

like image 158
Michael Ekstrand Avatar answered Oct 06 '22 18:10

Michael Ekstrand


User CPU Time: Amount of time the processor worked on the specific program.

System CPU Time: Amount of time the processor worked on operating system's functions connected to that specific program.

like image 34
N Randhawa Avatar answered Oct 06 '22 18:10

N Randhawa