Languages
[Edit]
EN

C#/.NET - get number of processors on the current machine

9 points
Created by:
Root-ssh
103660

In C#/.NET it is possible to get number of processors on the current machine with Environment.ProcessorCount property. 

Environment.ProcessorCount property example

int count = Environment.ProcessorCount;

Console.WriteLine("Number of available processors is " + count + ".");

Output:

Number of available processors is 4.

References:

  1. Environment.ProcessorCount Property - Microsoft Docs
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join