I want to retrieve the amount of time in milliseconds that a process has spent taking up CPU time since the process was started.
I can found in the /proc/<pid>/stat
the fields:
#14
utime
- CPU time spent in user code, measured in clock ticks#15
stime
- CPU time spent in kernel code, measured in clock ticks
I think the time I want is:
mytime = utime + stime
Am I right?
And How to convert the utime
and stime
from clock ticks to milliseconds ?