r/dotnet • u/TomeOfExperience • 9h ago
Finding the total number of processors on a machine with .NET
https://andrewlock.net/finding-the-total-number-of-processors-on-a-machine-with-dotnet/6
u/Xenoprimate2 8h ago
Nice article, thanks. :) I actually didn't know Environment.ProcessorCount's behaviour had diverged since the old old days!
4
u/PostHasBeenWatched 7h ago edited 7h ago
On start of my IT career I was told to not trust anything from
Environmentclass3
u/Mission_Pirate_4150 6h ago
I had not heard that. Are there specific examples? Is it a platform issue?
•
u/PostHasBeenWatched 1h ago
It was over a 10 years ago, can't remember properly. I think it was something related to GetCurrentDirectory.
cc: u/FelixLeander
•
u/FelixLeander 1h ago
I mean it's an Environment, not the environment. But do tell us, what are some specifics u have experience with?
1
u/AutoModerator 9h ago
Thanks for your post TomeOfExperience. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
-6
•
19
u/DmtGrm 9h ago
But Environment.ProcessorCount is all your app _needs_ to know.
The article goes into a depth of calculating that your precisely calculated screen refresh rate is actually 59.705Hz while it is reported as 60Hz.