You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When collecting the CPU utilization of the same process within the same time range, it is found that the value collected by glances will be larger, and the task manager that comes with Windows will be much less.
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.
When collecting the CPU utilization of the same process within the same time range, it is found that the value collected by glances will be larger, and the task manager that comes with Windows will be much less.
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.
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.
The performance counter module under WMI obtains the process CPU utilization, which should be the same as what is displayed in the task manager.
https://learn.microsoft.com/en-us/windows/win32/perfctrs/performance-counters-portal
https://learn.microsoft.com/en-us/windows/win32/wmisdk/monitoring-performance-data
The text was updated successfully, but these errors were encountered: