1

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?

AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152

1 Answers1

3

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%.

Ryan
  • 3,552
  • 1
  • 22
  • 39
  • This answer also mentions the 100% per CPU - http://stackoverflow.com/questions/11504438/correct-way-to-use-performancecounter-in-net-to-measure-cpu-usage – AwkwardCoder May 07 '13 at 08:21