Author Topic: Measuring Performance With Time  (Read 692 times)

Offline scotbuff

  • Sys Admin
  • UNIX User
  • *****
  • Posts: 174
  • Karma: +2/-0
    • View Profile
    • Scott.Buffington.me
Measuring Performance With Time
« on: January 13, 2006, 02:32:43 pm »
The time command can be an excellent tool for analyzing the performance of a shell script, program or command. When you run time followed by the command that you wish to time. Three results are printed when the program or script finishes executing:

The actual length of time (real-world time spent on the program). 
The total time spent in the program
The total time spent on CPU overhead. 

This can be useful for large or slow running scripts or programs to get an idea of just how much work they are actually doing.
 

$ time ./webstrip.sh
real    8m8.658s
user    0m25.700s
sys     0m1.850s