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.

I am using command time to find how much time two commands are taking to execute one process (one after another). However, sometimes it gives:

command 1 elapsed time is 5:34.05

and

command 2 elapsed time is 6:32.98

But, in another window where top command is running, it shows,

command 1 TIME+ is 2:34.05

command 2 TIME+ is 2:14.09

Can anybody help me why is this happening means when time command says that command 1 takes less time at that same time top command says completely opposite?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The top command does not show elapsed time, but CPU usage time. The time command shows elapsed time and CPU time.

share|improve this answer
    
Sorry, if anything wrong. But, I have very little idea about those. Actually, I am trying to find how much wall clock time both two commands are taking to execute some operations and as I have suggested, I am using time command, but what output it is giving is hard to believe (!), because I am seeing both of them executes in just 1/2 minutes but time command gives they take 5/6 minutes ? –  Arpssss Jul 16 '12 at 18:46
    
Are you running in a VMware guest? –  Michael Hampton Jul 16 '12 at 18:50
    
I don't know. But, how to check that ? –  Arpssss Jul 16 '12 at 18:55
    
I run this command: lshw -class system Outputs: WARNING: you should run this program as super-user. description: Computer width: 64 bits capabilities: vsyscall64 vsyscall32 [so probably NO] –  Arpssss Jul 16 '12 at 18:57
    
And my time command also looks like: 105.99user 49.45system 5:34.05elapsed 48%CPU (0avgtext+0avgdata 32554768maxresident)k 55581424inputs+68080outputs (33major+9644074minor)pagefaults 0swaps. If it helps. –  Arpssss Jul 16 '12 at 19:08
add comment

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.