Measure the running time of any command

Reading Time: 1 minute

Solution

$ time any-command-to-run

Example

For the following command:

$ time ./init_my_project.sh

After the script finished running, you’ll see:

real    1m37.121s
user    0m44.342s
sys     0m12.518s

Where

  • real means the elapsed real (wall clock) time used by the process, in seconds.
  • user means the total number of CPU-seconds that the process used directly (in user mode), in seconds.
  • sys means the total number of CPU-seconds used by the system on behalf of the process (in kernel mode), in seconds.

We transform challenges into digital experiences

Get in touch to let us know what you’re looking for. Our policy includes 14 days risk-free!

Free project consultation