1. Computing

Discuss in my forum

Juergen Haas

Linux Command time Measures Time and RAM Usage

By March 3, 2013

Follow me on:

If you are running jobs on a Linux server on which other processes are running and you want to measure how efficient a job runs, you cannot simply watch a clock and subtract the start time from the finish time, since you don't know how much CPU capacity the other processes are occupying and how much CPU cycles are lost in the overhead of switching processes. Fortunately Linux provides a simple solution: the time command.

Simply precede your command line with "time", and the system will report a number of time and memory statistics related to the resources used by your process. By default it will list the elapsed time (as read from a wall clock), the CPU time used by your process and the CPU time used by the system on behalf of your process. If the Linux server has multiple processor cores you can estimate how much (wall clock) time your job would need if there were no other processes running by dividing the reported CPU time by the number of cores.

See the time man page for more information.

No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
  1. About.com
  2. Computing
  3. Linux

©2014 About.com. All rights reserved.