Currently working on creating a sorts of "task manager" in c#/wpf. I've searched around but haven't found a solution to my problem.
I am trying to retrieve the CURRENT clock speed of one's CPU (not utilization, base, min/max). I have tried using ManagementObjects, but "CurrentClockSpeed" is always giving a fixed value of 3400, or 3.4GHz, which is the stock max speed of the CPU. I have tried many times and it gives me the same answer, so it isn't just a coincidence i think.
ManagementObject Mo = new ManagementObject("Win32_Processor.DeviceID='CPU0'");
uint sp = (uint)(Mo["CurrentClockSpeed"]);
System.Threading.Thread.Sleep(1000);
sp = (uint)(Mo["CurrentClockSpeed"]);
Mo.Dispose(); //return and such later in the code
Any suggestions on how to fix this issue (I am not bound to using ManagementObjects, I have OpenHardwareMonitor, and can use other packages if need be) are appreciated.