Home » Linux » The meaning of real, user, and sys in output of Linux time command [duplicate]

The meaning of real, user, and sys in output of Linux time command [duplicate]

Posted by: admin November 30, 2017 Leave a comment

Questions:

This question already has an answer here:

Answers:

If you take a look at the manpage (man time), it states:

The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard output giving timing statistics about this program run. These statistics consist of (i) the elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime and tms_cstime values in a struct tms as returned by times(2)).

Basically though, the user time is how long your program was running on the CPU, and the sys time was how long your program was waiting for the operating system to perform tasks for it. If you’re interested in benchmarking, user + sys is a good time to use. real can be affected by other running processes, and is more inconsistent.