DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

time(C)


time -- time a command

Syntax

time [ -p ] command [ argument ... ]

Description

The given command is executed with the specified arguments; on completion, time prints the following times:

real
time elapsed during the command,

user
time spent executing the command in user mode,

sys
time spent executing the command in system mode.
Programs which execute a large number of system calls (for example, performing input and output) will spend a greater proportion of time in system mode than programs which spend most of their time number crunching or character processing. As the system becomes more heavily loaded with processes, the total elapsed time will grow faster than the user or system times for a given command.

User and system times are reported in seconds and the elapsed time in minutes and seconds in csh(C). The times are printed on the standard output. The percentage of total CPU time taken by the command is also reported. The command time used with no argument returns the times for the current csh.

All times are reported in minutes and seconds on the standard error in ksh(C).

All times are reported in seconds on the standard error output when using the /bin/time version of this command.

The -p option causes timing output to be printed in seconds with each value appearing on a new line. For example:

$ time command
:
real
real elapsed time
user user elapsed time
sys system elapsed time
$

Exit values

The exit status returned by time is as follows:

1-125
An error occurred in the time utility

126
The utility specified to be timed was found but could not be invoked

127
The utility specified to be timed could not be found

Limitations

This command is built into csh and ksh.

The -p option is only available in the /bin/time and ksh(C) versions of time.

See also

csh(C), ksh(C), times(S-osr5)

Standards conformance

time is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005