The time
command is used to determine the amount of time it takes for a command to run. time
prints a summary of real
time, user
time, and sys
or system
time spent while executing the given command.
real
time refers to the wall clock time taken from the start to the finish of the command.user
time refers to the amount of CPU time spent in executing the command in user mode.sys
/system
time refers to the amount of CPU time spent in executing the command in kernel mode.time COMMAND_TO_EXECUTE
For example, time sleep 5
or time echo "hello"
.
time sleep 2