Question

I'm tracking the CPU utilisation for the process as part of regular heartbeat for an application, using code something similar to this:

  var process = Process.GetCurrentProcess();
  _processCpuCounter = new PerformanceCounter("Process", "% Processor Time", process.ProcessName);
  ...
  ...
  ...
  var processCPU = Convert.ToInt32(_processCpuCounter.NextValue());

NextValue is only evaluated once per minute.

I've observed the processCPU value to be greater than 100%, can anyone explain why this would be happening as mathematically it does not make sense?

Was it helpful?

Solution

Each core of the CPU has 100%, so 120% on a dual core could mean one is at 100% and the other is at 20%.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top