I need to implement the c++ code to show CPU utilization for system which should match task manager
Hello,
I am using Windows 11. Until last year, I was using the performance counter:
L"\Processor Information(_Total)\% Processor Utility"
With this counter, my application's CPU readings used to match the Task Manager values. However, after the recent Windows 11 updates, I noticed that the CPU utilization retrieved using this counter no longer aligns with Task Manager.
After testing, I found that the CPU usage now matches Task Manager only when using the counter:
L"\Processor Information(_Total)\% Processor Time"
Could someone please clarify which implementation is the correct one to use to ensure that my application stays consistent with Task Manager's CPU reporting?