Using Win32_PerfFormattedData_Counters_ProcessorInformation , you can use the PercentProcessorTime field, which will give instances of each core / thread on your system with the appropriate use.
I just tried this on my own and I have 8 control objects for my 8 threads.
using System; using System.Management; using System.Windows.Forms; namespace WMISample { public class MyWMIQuery { public static void Main() { try { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PerfFormattedData_Counters_ProcessorInformation"); foreach (ManagementObject queryObj in searcher.Get()) { Console.WriteLine("-----------------------------------"); Console.WriteLine("Win32_PerfFormattedData_Counters_ProcessorInformation instance"); Console.WriteLine("-----------------------------------"); Console.WriteLine("PercentProcessorTime: {0}", queryObj["PercentProcessorTime"]); } } catch (ManagementException e) { MessageBox.Show("An error occurred while querying for WMI data: " + e.Message); } } } }
Update:
It was an easy lie, I had 10 copies. Their names were:
etc .. You should filter what you need with the where clause:
SELECT PercentProcessorTime FROM Win32_PerfFormattedData_Counters_ProcessorInformation WHERE NOT Name='_Total' AND NOT Name='0,_Total'
source share