Friday, June 6, 2008

Linux time command

The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard output giving timing statistics about this program run.

See below example:

[vishnu@solaris /mnt/usr/vishnu] time myProgram arg1

real 24m10.951s

user 6m2.390s

sys 0m15.705s

[vishnu@solaris /mnt/usr/vishnu]

Above command outputs the time taken by myProgram.

· real - Elapsed time from beginning to end of program

· user - time used by the program itself and any library subroutines it calls

· sys- time used by the system calls invoked by the program (directly or indirectly)

No comments: