Hi guys,
I have the following question:
When I use the "cpu_times_percent" function to get the nice, iowait, idle value.
The values when I run inside python they are returned but when I run inside a .py file for example psutil.cpu_times_percent().user or psutil.cpu_times_percent().idle the values are reset.
Does anyone know the reason?
Exemple:
Inside python:
>>> psutil.cpu_times_percent()
scputimes(user=0.4, nice=0.0, system=0.7, idle=98.9, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
Out of pyhon:
python3.7 test.py
scputimes(user=0.0, nice=0.0, system=0.0, idle=0.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
Thanks!