Interpreting UNIX time function

Posted on 2006-04-18
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.
Question by:soapergem
    LVL 23

    Expert Comment

    The gnu version of the time command puts out several statistics.  They are explained here:
    LVL 6

    Author Comment

    I don't speak man pages. Can someone explain what those mean in English?
    LVL 23

    Accepted Solution

    > 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.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
    Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    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.

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now