performance counter in c# - calculate average of sample
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.
i have created 2 counters one as
PerformanceCounterType.AverageCount64
and the seconds as
Performance开发者_如何学PythonCounterType.AverageBase
i am adding them ine after the other (the base come second)
for every frame i am calculating the diff and increase both counters e.g
pc.increaseby(40)
pcbase.increaseby(1)
on second process i want to display the counter so when i am calculating
Single numerator = (Single)s1.RawValue - (Single)s0.RawValue;
Single denomenator = (Single)s1.BaseValue - (Single)s0.BaseValue;
Single counterValue = numerator / denomenator;
the basevalue is always 0 -> any ideas?
精彩评论