Friday, September 02, 2005

time and /bin/time

time and /bin/time differ primarily in that time is built into the C
shell. Therefore, it cannot be used in Bourne shell scripts or in
makefiles. It also cannot be used if you prefer the Bourne shell (sh).
/bin/time is an independent executable file and therefore can be used
in any situation. To get a simple program timing, enter either time or
/bin/time, followed by the command you would normally use to execute
the program. For example, to time a program named analyze, enter the
following command:

% time analyze inputdata outputfile
9.0u 6.7s 0:30 18% 23+24k 285+148io 625pf+0w

This indicates that the program spent 9.0 seconds on behalf of the
user (user time), 6.7 seconds on behalf of the system (system time, or
time spent executing UNIX kernel routines on the user's behalf), and a
total of 30 seconds elapsed time. Elapsed time is the wall clock time
from the moment you enter the command until it terminates, including
time spent waiting for other users, I/O time, etc.


Post a Comment

<< Home