Task Manager calls NtQueryInformationProcess with ProcessTimes, which is the same thing as GetProcessTimes
It can also be done with PDH (How To Retrieve Performance Counter Value Using PDH)
How is the process CPU usage in Task Manager calculated
Abraham Alaniz
1
Reputation point
I'm using PowerShell to attempt to recreate a similar output as seen for the CPU usage in Task Manager under Processes.
What formula is used to get these numbers?
All I've seen is that the counter Process Timer is what's displayed in the Details section for the individual app, while the overall CPU usage is displayed with Processor Utility counter. I understand how and what is used to get the results seen in the Details tab, but how do I get the CPU usage as shown under the process tab for an individual/all apps?
1 answer
Sort by: Most helpful
-
Castorix31 84,286 Reputation points
2022-09-09T06:36:36.933+00:00