I'm trying to retrieve the performance information of all physical cores on my machine. I have attempted the following code:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_PerfFormattedData_PerfOS_Processor");
foreach (ManagementObject obj in searcher.Get())
{
var usage = obj["PercentProcessorTime"];
var name = obj["Name"];
}
Sourced from here
However, this returns the info of the logical processors and not the physical cores. For example, I have a hyperthreaded quad-core and therefore this code returns the info for 8 processors where, in fact, I only want the 4 physical one