I've been trying to move away from using the PerformanceCounter class for monitoring a process's CPU usage since it seems it requires a decent amount of CPU when the process count gets decently high (when monitoring a lot of processes).
My first approach was to take the WMI route using Win32_PerfFormattedData_PerfOS_Processor class and the PercentProcessorTime property, but there seems to be an issue when trying to calculate the CPU usage over multiple cores (the max value it's returning is 100% making it impossible to divide it based on the CPU core count, resulting in inaccurate results).
So finally I decided to use the Process's class TotalProcessorTime property. Sadly I am unsure how to calculate the percentage of the total CPU usage used by the Process based the value. I know that I should subtract the current PercentProcessorTime value from a previous PercentProcessorTime value to get how much time the processor spent on the process within a certain time limit but I am unsure how to continue from there.
Thanks in advance.