Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TIME

Status
Not open for further replies.

gregsimpson

Programmer
Apr 18, 2002
521
Can anyone tell me what the 3 values as returned by TIME in the example below represent.

$ time db2 <gregfile >outfile

real 1m48.64s
user 0m4.17s
sys 0m11.33s


 
Check out the man page for time:

DESCRIPTION
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)).
 
Hi,

I had already checked out man. This explanation doesn't mean to much to me. Can you expand on it further please in laymans terms.

Cheers
Greg
 
real = the total amount of time it took to execute the command. In this case that was one minute and forty eight point six four seconds.

user = the amount of time the command was running user code. User code is a program instruction that doesn't involve a system call.

sys = the amount of time the command was running system, or kernel, code.

real 1m48.64s
user 0m4.17s
sys 0m11.33s

You'll notice that user and sys times don't add up to real. This is quite possible, commands often spend time idle when other things are running; the example above is quite extreme though. Mike
________________________________________________________________

&quot;Experience is the comb that Nature gives us, after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top