Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
This chapter is from the book

time

The time command can be used to measure the execution time of a specified program. When the program finishes, time writes a message to standard output, giving timing statistics about the program that was run. Figure 1.4 shows the timing for the list directory contents command (ls) with the -R option, which recursively lists subdirectories.

Figure 1.4

Figure 1.4 Timing the ls command with time.

Figure 1.5 shows the finishing up of the ls command and the three timings (real, user, and sys) produced by time.

Figure 1.5

Figure 1.5 The results of timing the ls command with time.

The output from time produces three timings. The first is real, which indicates that 4 minutes and 58.045 seconds elapsed during the execution of the ls command, that the CPU in user space (user) spent 9.520 seconds, and that 26.760 seconds were spent executing system (sys) calls.

  • + Share This
  • 🔖 Save To Your Account