C# Program to Get Number of Processors of Current Machine using Environment Class Last Updated : 24 Oct, 2021 Comments Improve Suggest changes Like Article Like Report Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environment variable settings information, contents of the call stack information, and time since last system boot in milliseconds information. In this article, we will discuss how to get the number of processors of the current machine. So, we use the ProcessorCount property of the Environment class. This property returns the count of processors present in the current process. Syntax: Environment.ProcessorCount Return Type: The return type of this property is 32-bit signed integer. Example: C# // C# program to find the number of processors of // the current machine using Environment class using System; class GFG{ static public void Main() { // Declare a variable int result; // Now find the number of processors // of the current machine // Using ProcessorCount property result = Environment.ProcessorCount; // Display the result Console.WriteLine("Total number of processors " + "in current process is " + result); } } Output: Total number of processors in current process is 4 Comment More infoAdvertise with us Next Article C# Program to Demonstrate the Use of GetCommandLineArgs() Method of Environment Class O ojaswilavu8128 Follow Improve Article Tags : C# CSharp-programs Similar Reads C# Program to Get the Machine Name or Host Name Using Environment Class Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environme 1 min read C# Program to Get Current Stack Trace Information Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Demonstrate the Use of GetCommandLineArgs() Method of Environment Class Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that retrieves command-line arguments information, exit codes information, environme 3 min read C# Program to Get the Network Domain Name Associated with Current Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Get the Number of Milliseconds Elapsed Since System Started Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read C# Program to Get the Path of System Directory Using Environment Class In C#, Environment Class provides information about the current platform and manipulates, the current platform. It is useful for getting and setting various operating system-related information. We can use it in such a way that it retrieves command-line arguments information, exit codes information, 2 min read Like