?
Solved

Interpreting UNIX time function

Posted on 2006-04-18
3
Medium Priority
?
359 Views
Last Modified: 2010-04-21
Hi all. I suppose this question could have gone in Linux just as well, but it really is a UNIX function, if I'm not mistaken. I've been benchmarking (or trying to) a quick little program I wrote, call it "benchmark," that receives one command-line integer. But I'm still rather unfamiliar with UNIX / Linux platforms, so I'm not entirely sure what all of the nonsense that the time function throws back at me actually represents. I execute this command (where n is some integer):
    time benchmark n

Here are some examples of output that I've gotten back:
1.676u 0.002s 0:01.67 100.0%      0+0k 0+0io 0pf+0w
1.697u 0.011s 0:01.70 100.0%      0+0k 0+0io 0pf+0w
1.704u 0.011s 0:01.71 100.0%      0+0k 0+0io 0pf+0w
1.735u 0.011s 0:01.74 100.0%      0+0k 0+0io 0pf+0w

I counted seven things that are output in each test. I believe the first one is the time it took to execute the program in seconds (although I don't know why it's followed by a 'u'), but I don't know what the last six represent, and the man page didn't make much sense to me. What does all that mumbo-jumbo mean? Please explain the remaining six output parameters.
0
Comment
Question by:soapergem
  • 2
3 Comments
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 16484293
The gnu version of the time command puts out several statistics.  They are explained here:
http://unixhelp.ed.ac.uk/CGI/man-cgi?time
0
 
LVL 6

Author Comment

by:soapergem
ID: 16484336
I don't speak man pages. Can someone explain what those mean in English?
0
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 2000 total points
ID: 16484457
> I don't speak man pages.

The man pages are the definitive documentation for unix commands.
They are not cryptic and are generally written in English.   You should
really put the smallest amount of effort into reading them.  In this case
the fields printed are [ in left to right order ]:

Total number of CPU-seconds that the process spent in user mode.
Total number of CPU-seconds that the process spent in kernel mode.
Elapsed real time (in [hours:]minutes:seconds).
Percentage of the CPU that this job got.
Average size of the process's shared text space (the executable code), in Kbytes + Average size of the process's unshared data area, in Kbytes.
Number of file system inputs by the process + Number of file system outputs by the process.
Number of major page faults that occurred while the process was running.  These are faults where the page has to be read in from disk. +
Number of waits:  times that the program was context-switched voluntarily, for instance while waiting for an I/O operation to complete.


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question