[RESOLVED] How to determine processor load?
I have a multi-processing application that kicks off up to 4 threads at a time to process data into a SQL-Server database. It seems to work okay, except at times the processors are pegged at 100% and all threads slow down a bit.
So, what I want to do is conditionally fire a thread based upon the processor load... if they're already running at 100%, it makes no sense to kick off another thread.
Is there a way to determine what the processor load is? Task manager shows processor load, so there probably is... but how do I do it?
Re: How to determine processor load?
Here's a C# example of getting the CPU Usage.
Re: How to determine processor load?
Okay, that code worked fine. Thanks for posting it.