79

If I issue the "top" command and receive results such as:

PID   USER  PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND   
00001 bob   25   0 77380 1212 1200 R 95.8  0.0  89122:13 fee         
00002 bob   25   0 77380 1196 1184 R 95.4  0.0  88954:14 fi         
00003 sam   18   0  427m  16m 6308 R 30.0  0.1  54:46.43 fo         
00004 sam   18   0  427m  16m 6308 R 26.5  0.1  52:55.33 fum         

Question: What are the units in the "TIME+" column?

What I have tried: (please suggest a better strategy for searching documentation ...)

  • man top | grep -C 4 time or
  • man top | grep <X> when I substitute minute, hour, day, or HH for X ...

2 Answers 2

74

ps and top display CPU time used, not clock time since the process started. One way to check when the process started is use the following command. The PID file creation date is when the process started:

ls -ld /proc/pid

So for process 2303 it would be:

ls -ld /proc/2303
6
  • 2
    I don't see anywhere where Gilles said that the values showed clock time...
    – Chris Down
    Commented Feb 13, 2013 at 11:35
  • Well it leads 'anyone' in mistake, in my opinion.
    – PJunior
    Commented Apr 23, 2014 at 21:28
  • 23
    Your answer is useful, but stating the 'other answer is totally wrong', is (in my opinion) not accurate. The original question is what units are used. The 'other answer' answers that. It just doesn't specify that this is a measurement of CPU time, not clock time. Your answer clarifies that and so it is useful (but doesn't answer the original question). I will vote your answer up if you remove from your answer that the other answer is 'totally wrong'.
    – Jason S
    Commented May 8, 2014 at 1:51
  • 2
    This does not seem to work for long running process (may be it does not work for short jobs as well). I see this file gets updated for some other reason as well. There is another way to calculate when the process is created (stackoverflow.com/questions/5731234/…)
    – Ganesh
    Commented Dec 8, 2016 at 17:48
  • Didn't work for me, after process running for 2 days this file reported a very recent modified time. Also, the OP was "what units", while this is interesting...off topic. Commented Apr 5, 2019 at 18:29
64

minutes:seconds.hundredths

Searching for “TIME+” or for “seconds” gives the answer, kind of (I wouldn't call the man page clear).

This format is inherited from BSD, you also get it with ps u or ps l under Linux.

6
  • thanks ... (I found TIME+ from the first search, but was daunted); can I assume that 89122:13 is in units of MM:SS, (89122 minutes and 13 seconds = 60 days)?
    – Abe
    Commented Oct 30, 2012 at 0:11
  • 1
    @Abe Yes, 89122:13 = 5347333 seconds ≈ 62 days. Commented Oct 30, 2012 at 0:19
  • 1
    @Abe I guess that we can divide that given time for the number of cores and get the clock time since it started...
    – PJunior
    Commented Apr 23, 2014 at 21:29
  • @Gilles I'm new to Linux. Which time does TIME+ signify? For how much time the job is running? Commented Apr 13, 2018 at 12:05
  • @mithusengupta123 That's the amount of CPU time used by the process. It may be a lot less than how long the process has been running if the process isn't CPU-bound, for example a process that spends most of its time idle waiting to serve requests. Commented Apr 13, 2018 at 14:27

You must log in to answer this question.

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