time

Updated: May 06, 2022

Determine the execution time of a command (UNIX)

Syntax:

time [options] command 

Runs on:

QNX Neutrino

Options:

-p
Switch the timing output format to IEEE Std 1003.2-1992 ("POSIX.2") format.
command
The command, including any of its options, for which the execution time is to be determined.

Description:

The time utility and the time shell built-in determine the execution time of command, which must be specified. When execution of command is complete, the time utility displays (prints to standard error) the total elapsed time for execution, the time spent in the system, and the time spent in executing command. By defaut, times are reported in hours, minutes, and seconds.

Times aren't always accurate to the milliseconds as displayed, depending on the tick size.

Examples:

Display the execution times in default format:

$ time sleep 76

01:16.000s real   00.000s user   00.000s system

Display the execution times in POSIX.2 format:

$ time -p sleep 76

real 76.00
user 0.00 
sys 0.00

Exit status:

The time utility exits with the exit status of the command that was timed.