C# - Get the CPU speed in Mhz

By , 8/22/2007
(1 ratings)
Get the CPU speed in Mhz
// ad a reference to System.Management !
using System.Management;

public uint CPUSpeed()
{
  ManagementObject Mo = new ManagementObject("Win32_Processor.DeviceID='CPU0'");
  uint sp = (uint)(Mo["CurrentClockSpeed"]);
  Mo.Dispose();
  return sp;
}

Tagged with cpu, processor, Mhz.

Comments

 

Log in, to comment!