Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
 time a.out 
 106.130u 0.000s 1:46.28 99.8%   0+0k 0+0io 83pf+0w

As per my understanding of the man page:

  • the first value is the time since the code execution started and ended,
  • the second values is the time spent in usermode
  • the third one being in kernel mode

Is the 99.8% indicating time spent in kernel mode?

Also, what does this indicate?

0+0k 0+0io 83pf+0w .

The program definitely takes more than a minute to execute – then why is the first value so small?

share|improve this question

migrated from stackoverflow.com Sep 21 '11 at 4:30

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 1 down vote accepted

From the manpage:

The default format is:

    %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
    %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

So, 106 seconds spent in userspace, 0 seconds in kernelspace, 1 minute and 46 seconds elapsed "real" time.

As for "why is the first value so small" - it isn't. Note that 106 seconds == 60 seconds + 46 seconds == 1 minute 46 seconds, which is the time elapsed. I don't see a discrepancy there.

share|improve this answer
    
Thank you.. i was getting confused seeing the first u with the first value thinking it was microsecond. Really dumb –  f-z-N Sep 21 '11 at 9:10

Use the unix manual page for time:

>man time

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.