- The elapsed (real) time between invocation of utility and its termination.
- The User CPU time, equivalent to the sum of the tms_utime and tms_cutime fields returned by the times(2) function for the process in which utility is executed.
- The System CPU time, equivalent to the sum of the tms_stime and tms_cstime fields returned by the times() function for the process in which utility is executed.
When time is used as part of a pipeline, the times reported are unspecified, except when it is the sole command within a grouping command in that pipeline. For example, the commands on the left are unspecified; those on the right report on utilities a and c, respectively.
time a | b | c { time a } | b | c a | b | time c a | b | (time c)
real %f\nuser %f\nsys %f\n <real seconds>,
<user seconds>, <system seconds>
Alternatively, the following command can be used to apply time to a complex command:
time sh -c ’complex-command-line’
The following two examples show the differences between the csh version of time and the version in /usr/bin/time. These examples assume that csh is the shell in use.
example% time find / -name csh.1 -print /usr/share/man/man1/csh.1 95.0u 692.0s 1:17:52 16% 0+0k 0+0io 0pf+0wSee csh(1) for an explanation of the format of time output.
example% /usr/bin/time find / -name csh.1 -print /usr/share/man/man1/csh.1 real 1:23:31.5 user 1:33.2 sys 11:28.2Environment
See environ(5) for descriptions of the following environment variables that affect the execution of time: LC_CTYPE, LC_MESSAGES, LC_NUMERIC, NLSPATH, and PATH.Exit Status
If utility is invoked, the exit status of time will be the exit status of utility; otherwise, the time utility will exit with one of the following values:
- 1-125
- An error occurred in the time utility.
- utility was found but could not be invoked.
- utility could not be found.
See Also
csh(1) , shell_builtins(1) , timex(1) , times(2) , environ(5)Notes
When the time command is run on a multiprocessor machine, the total of the values printed for user and sys can exceed real. This is because on a multiprocessor machine it is possible to divide the task between the various processors.When the command being timed is interrupted, the timing values displayed may not always be accurate.
Bugs
Elapsed time is accurate to the second, while the CPU times are measured to the 100th second. Thus the sum of the CPU times can be up to a second larger than the elapsed time.