I am trying to get the CPU usage time of my Python program using time python my_code.py
, where the program executes a long deep learning training process. The result of time command is 244m
for user-time and 13.5m
for sys-time (after dividing by the number of cores). However, the CPU time obtained from Centos 7 resource manager of the running process is only 187.5m
and it's almost identical to the value obtained in ps
command.
Shouldn't the value of (user-time+sys-time) be the same as the one obtained with the resource manager(or ps command)? If not, why user+sys = 13.5 + 244 = 257.5m
is much bigger than process CPU time (187m
)?
Which one represents the CPU time of the process?