So I have a program, where i'm getting general information about the user's machine. And I'm attempting to get multiple entries from WMI's Win32_Processor, namely the processors name, clockspeed, architecture and core count. However, selecting the whole thing is very speed detrimental. So i'm trying to figure out if I can query for multiple entries without using a wildcard.
ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_Processor");
searcher.Get();
foreach (ManagementObject share in searcher.Get())
{
var clockSpeedM = share["CurrentClockSpeed"];
var Name = share["Name"];
var CoreCount = share["NumberOfCores"];
double clockSpeedG = Math.Round(Convert.ToDouble(clockSpeedM) / 1000, 2);
if (share["Architecture"].ToString() == "9")
{
Name = Name + " (64-bit)";
}
else
{
Name = Name + " (32-bit)";
}
return Name + " " + CoreCount + " cores" + " ~" + clockSpeedG + "GHz";
}