-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Why are the indicators collected by psutil too large? #2384
Comments
After reading the latest psutil source code, the CPU utilization uses the GetSystemTimes API, but the calculation of the CPU utilization in the task manager after win10 has changed. The GetSystemTimes API has been a long time ago, and now it is replaced by a "performance counter", so there are inconsistencies. |
After doing a benchmark test, the CPU utilization output by psutil was 55%, and the result using a PowerShell script combined with Windows Performance Counters was 6%. The difference is nearly 10 times. |
@giampaolo Hello, can you help me take a look? |
Do you have any idea in what Windows version |
First of all, thank you for your answer. After reading the psutil documentation, I found that there is no problem in calculating the CPU utilization of a process in Windows. It was my misunderstanding. |
Summary
When collecting the CPU utilization of the same process within the same time range, it is found that the value collected by psutil will be larger, and the task manager that comes with Windows will be much less.
The text was updated successfully, but these errors were encountered: