C# Program to Get Number of Processors of Current Machine 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, 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.
Return Type: The return type of this property is 32-bit signed integer.
Total number of processors in current process is 4