Click here to Skip to main content
14,447,974 members
Rate this:
Please Sign up or sign in to vote.
See more:
how can i check my pc cpu usage for previous time
Member 10331093 11-Oct-13 16:57pm
any one help me very needfull

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You can't.

You'll need to take a reading whenever you know you'll need it in the future and store it in a variable.

I once did the following and worked like a charm:
Took readings of CPU usage into an array every so many seconds. Maybe just 2 variables may work for you.
Then, as well, every so many seconds I "pulled down" my readings so the newest reading would take the first place in the array.

I did that with Timer "thread" from System.Windows.Forms library (be careful, cause there is another Timer class in System.Threading -of which I'm not a fan.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100