Hello everyone, I was reading about POSIX threads and they gave a table about CPU usage. I don't understand the difference between real, user, and sys . Could somebody help me out?
Hello everyone, I was reading about POSIX threads and they gave a table about CPU usage. I don't understand the difference between real, user, and sys . Could somebody help me out?
Real - The elapsed (real) time between invocation of the application being timed and its termination.
User - The User CPU time, equivalent to the sum of the tms_utime10.1 and tms_cutime 10.2fields returned by the times(2) function for the process in which utility is executed.
Sys - The System CPU time, equivalent to the sum of the tms_stime 10.3 and tms_cstime 10.4 fields returned by the times(2) function for the process in which utility is executed.
Could you clarify on the difference between User and Sys time?
On a UNIX system, a process (an instance of a program running) will be executing in one of two modes; user mode, or kernel mode. The process will generally be in user mode until, for example, a system call is made. Then the mode switches to kernel mode in order to service the request. I believe that user time and system time corresponds to the time spent in both user mode and kernel mode respectively.Originally Posted by Kleid-0
If you are using a *nix machine (and I have assumed that you are) then look at the man pages for time and times(2)
~/
Last edited by kermit; 07-22-2005 at 03:25 PM.