performance counter in c# - calculate average of sample
<p>hi
i am grabbing frames from ip camera and want to export via perf counters the time diff between frames. and present it as # timediff / sec.</p>

<p>i have created 2 counters one as </p>

<p>PerformanceCounterType.AverageCount64 </p>

<p>and the seconds as </p>

<p>PerformanceCounterType.AverageBase</p>

<p>i am adding them ine after the other (the base come second)</p>

<p>for every frame i am calculating the diff and increase both counters e.g </p>

<pre><code>pc.increaseby(40) 
pcbase.increaseby(1)
</code></pre>

<p>on second process i want to display the counter so when i am calculating</p>

<pre><code>Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
Single counterValue = numerator / denomenator; 
</code></pre>

<p>the basevalue is always 0 -> any ideas?</p>
