Reputation: 753
I use System.Diagnostics.Process.GetProcesses() to get process list. I found TotalProcessorTime property for each process - it is TimeSpan.
But how to get relative values of CPU usage, i. e. i need % of total CPU usage for each running process.
Upvotes: 0
Views: 2551
Reputation: 753
I found a workaround decision see this question
The plan is as follows: take counters data in stndard way, then process log files. Realtime monitoring is not critical.
Upvotes: 0
Reputation: 1112
use WQL (queries WMI like SQL) see attached link for few samples:WQL
Win32_PerfFormattedData_PerfProc_Process is your class for getting CPU data.
Upvotes: 1