C# Environment ProcessorCount
Description
Environment ProcessorCount
gets the number of processors
on the current machine.
Syntax
Environment.ProcessorCount
has the following syntax.
public static int ProcessorCount { get; }
Example
The following example demonstrates the ProcessorCount property.
/*from w w w . j av a 2 s . c o m*/
using System;
class Sample
{
public static void Main()
{
Console.WriteLine("The number of processors " +
"on this computer is {0}.",
Environment.ProcessorCount);
}
}
The code above generates the following result.