A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.environment.processorcount below:

Environment.ProcessorCount Property (System) | Microsoft Learn

Environment.ProcessorCount Property Definition

Gets the number of processors available to the current process.

public:
 static property int ProcessorCount { int get(); };
public static int ProcessorCount { get; }
static member ProcessorCount : int
Public Shared ReadOnly Property ProcessorCount As Integer
Property Value

The 32-bit signed integer that specifies the number of processors that are available.

Examples

The following example demonstrates the ProcessorCount property.

// This example demonstrates the
//     Environment.ProcessorCount property.
using System;

class Sample
{
    public static void Main()
    {
    Console.WriteLine("The number of processors " +
        "on this computer is {0}.",
        Environment.ProcessorCount);
    }
}
/*
This example produces the following results:

The number of processors on this computer is 1.
*/
// This example demonstrates the
//     Environment.ProcessorCount property.
open System

printfn $"The number of processors on this computer is {Environment.ProcessorCount}."

// This example produces the following results:
//     The number of processors on this computer is 1.
' This example demonstrates the 
'     Environment.ProcessorCount property.
Class Sample
   Public Shared Sub Main()
      Console.WriteLine("The number of processors " & _
                        "on this computer is {0}.", _
                        Environment.ProcessorCount)
   End Sub
End Class
'
'This example produces the following results:
'
'The number of processors on this computer is 1.
'
Remarks

On Linux and macOS systems for all .NET versions and on Windows systems starting with .NET 6, this API returns the minimum of:

The value returned by this API is fixed at .NET runtime startup for the process lifetime. It does not reflect changes in the environment settings while the process is running.

For more information about processor groups and logical processors, see Processor Groups.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4