Steve Trefethen
Contact me
About Me View my LinkedIn profile

Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
Need consulting?
Need Consulting?

Spread Thunderbird

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Calculating process CPU usage

October 28 2006 9:31PM
Recently, I needed a routine to calculate CPU usage so that I could detect when a process went idle. As usual a quick search on Google Groups turned up the answer in this post. The routine calls GetProcessTimes then sleeps for a brief period, calls it again and calculates the average over that interval. The only change I made was to take into account the number of CPU's on the system by calling GetSystemInfo and divide accordingly.
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Tags:

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Spam filtering provided by: Spam Counter
335 comments approved, 1474 spam caught since October 28, 2009
Powered by Commentor