Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know the time command allows you to time the execution of a given command. But is it possible to get the execution time of the previous command without re-executing that previous command?

share|improve this question
Only if it happened to log something somewhere at the beginning and end of its run, and both entries included a timestamp. – Sammitch Feb 20 '13 at 21:38
up vote 11 down vote accepted

If you run around the block and don't measure the amount of time it took, didn't watch any clocks before, during or after and no people saw you do it, you also don't know how long it takes on average; would you be able to tell how long it took you to run around the block?


At best, you can know when you launched a certain application.


But that doesn't tell you when it has ended, which you will need to deduce, if at all possible.

share|improve this answer
It could have been possible that the duration of every command was stored temporarily somewhere. I would have found it surprising if it was like that but it's not like I haven't been surprised before, no need to be patronizing. That command to know when a command was launched is good to know however, thanks. – Bentley4 Feb 20 '13 at 22:01
@Bentley4: If there were such thing, there would have been an option for that in the kernel; there are options for that, but these options are tracing tools that aren't enabled by default which brings it down to needing to turn on the tracing in advance. The only remaining thing I can think off is an ability to know when you gained back your input (so you can do $input_time - $last_history_touch), but I don't know if that is kept track of anywhere. Maybe you can set up something preventive that allows you to determine the run time of any prior process at any point in time... – Tom Wijsman Feb 20 '13 at 22:07
Good advice, thanks. – Bentley4 Feb 20 '13 at 22:20

You must log in to answer this question.

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