Please do not cross post. You have created 2 messages on the ml and filed an issue on the bug tracker.
As for your question: the 2 *single* CPU usage values cannot be exactly the same if you compare them at an exact moment in time.
To have a meaningful result you should collect, say, 10 values with 1 second interval and then calculate the average as in (a + b + ...) / 10.
On Monday, May 20, 2013 8:39:08 AM UTC+2,
senzh...@gmail.com wrote:
I have a task which needs to detect CPU usage of a process.
I am using psutil library. When the program is running, Task Manager
shows that it is using(35%), however when I use this code
import psutil
psutil.get_pid_list()
p = psutil.Process(3256)
print p.get_cpu_percent(interval=1)
it shows : CPU usage is 79.7%
Why there is such a big difference between Task Manager data and
psutil?
why psutil does not match Task Manager ?