title: Calculating Averages with Performance Counters
body: <p>I have a service process, and I want to use performance counters to publish the average time that it takes to complete tasks.  I am using the AverageTimer32 counter to do this.</p>
  
  <p>It's almost working the way I want, but not quite:  When I increment the counter, it will briefly bump up to the value that I expect (watching in Performance Monitor), but then it drops right back down to zero.  </p>
  
  <p>So, the counter is zero, I  run a task, the task completes, the counter briefly bumps up (to the correct value), but then it almost immediately falls back to zero.</p>
  
  <p>I am using the AverageTimer32 counter with an AverageBase as the denominator.  I increment the AverageBase by 1 every time I start a task, and then I increment the AverageTimer32 by the number of ticks to complete every time I finish the task.  Can anyone give me a push?</p>