title: Rolling Timer Array for Calculating Averages
body: <p><strong>Language:</strong> C++</p>
  
  <p><strong>Development Environment:</strong> Microsoft Visual C++</p>
  
  <p><strong>Libraries Used:</strong> MFC</p>
  
  <p><strong>Problem:</strong> This should be fairly simple, but I can't quite wrap my head around it. I'm attempting to calculate a rolling average over a given amount of time - let's say five seconds. Every second, my program receives a data message containing some numerical information, including the CPU idle time during the process. </p>
  
  <p>I want to be able to show the user an average CPU idle time over a five second period. I was thinking about using just an array and storing a value every five seconds, but I'm not sure how to do the rolling portion. Unless there is some other built-in method for doing rolling calculations?</p>