2

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?

1 Answer 1

2

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

5
  • 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
    Commented Jul 16, 2012 at 18:46
  • Are you running in a VMware guest? Commented Jul 16, 2012 at 18:50
  • I don't know. But, how to check that ?
    – Arpssss
    Commented Jul 16, 2012 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
    Commented Jul 16, 2012 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
    Commented Jul 16, 2012 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .