How to find the amount of time a process spends in user mode or kernel mode
0
votes
1
answer
1612
views
I read through the docs for cat /proc/pid/stat It displays many numbers.
The process I am calculating this for is running in an infinite loop. So the values will keep on changing. I see that there is something called utime and stime
I am not sure if these give the exact user time and kernel time for the running process?
Also is there a way to just extract these two numbers from the output rather than manually determining which number corresponds to utime and stime?
I am not sure if these give the exact user time and kernel time for the running process?
Also is there a way to just extract these two numbers from the output rather than manually determining which number corresponds to utime and stime?
Asked by rohit
(1 rep)
Feb 14, 2022, 08:23 PM
Last activity: Sep 22, 2022, 02:29 PM
Last activity: Sep 22, 2022, 02:29 PM