time(1) — Commands
NAME
time − Times the execution of a command
SYNOPSIS
time [-p] command [argument ...]
The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution of the command on the diagnostic output system.
FLAGS
-pWrites the timing output to standard error. This is the default.
DESCRIPTION
The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution of the command on the diagnostic output system. Time is reported in seconds.
The time command (with a different format) is also built into csh.
EXAMPLES
To measure the time required to run a program, enter:
time a.out
This runs the program a.out and writes to the standard error output the amount of real, system, and user time that it uses:
real10.5
user 0.3
sys 3.6
EXIT VALUES
The time command returns the following exit values:
1-125An error occurred.
126The utility was found but could not be invoked.
127The utility could not be found.
RELATED INFORMATION
Functions: times(3).