Monday, August 9, 2010

Time in ps command

Today I learned something that I always thought was right when it was actually wrong.
It is the TIME in ps command.

$ ps ux
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
user1      991  0.0  2.4 19282 9076 ?        S    15:05   0:00 kdeinit: kded    
user1      780  0.1  1.0  5890 3044 ?        S    16:39   0:01 artsd -F 10 -S 40


The TIME in above output does not mean the total time since the process actually started. But it actually means the total time the process was processing. In other words, it is the sum of all durations the process was actually on the processor(s).

It was a true serendipity indeed!