Yesterday, I needed to determine the runtime of a Linux process for a monitoring script.
Cos the format for start_time of the ps command may change if the process was not started in the same year, I decided to take the neccessary informations from the /proc/<PID>/stat file.
In this file the process start time since boot is defined at the twenty-second field, expressed in Jiffies – the scale unit of the system timer. (One Jiffie is one tick of the system timer).
To convert Jiffies to seconds I just have to …[Read more...]