How to find the number of threads used by the processor? And the current processor speed (GHz)? Here is a picture - what do you need

How can I get this data out?

  • CreateToolhelp32Snapshot - Vladimir Klykov

1 answer 1

I’m not sure what speed of the core the Task Manager shows, and what this code will produce:

 int threadsCount = Process.GetProcesses() .Select(p => p.Threads.Count) .Sum(); uint clock; using (var mo = new ManagementObject("Win32_Processor.DeviceID='CPU0'")) { clock = (uint)mo["CurrentClockSpeed"]; } Console.WriteLine(clock); Console.WriteLine(threadsCount);