ps-p 986-o etime
can get the execution time of process 986, regardless of whether the system time has changed or not, it can return the correct result:
-bash-4.2$ ps -p 986 -o etime
ELAPSED
13-00:25:12
the above shows that the 986 process has been running for 13 days, 25 minutes and 12 seconds.
it can be seen that it accumulates the real running time of the program, not the difference between the running time of the system and the start of the process (this is not accurate in other cases such as time Synchronize, which can cause changes in the time of the system).
I looked at / proc/986/stat, / proc/986/status and other system files, and found no corresponding process running time value. ps-p 986-o etime
how is it implemented?