Updated: October 28, 2024 |
Determine the execution time of a command (UNIX)
time [options] command
QNX Neutrino
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 default, times are reported in hours, minutes, and seconds.
Times aren't always accurate to the milliseconds as displayed, depending on the tick size.
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
The time utility exits with the exit status of the command that was timed.