Example of creating a Performance Counter and incrementing it.

Note: that creating a reference to a counter is costly and should not be part of the function to increment it in most scenarios.

if(!PerformanceCounterCategory.Exists("SampleCategory", CreateCounter()));

PerformanceCounter counter = new PerformanceCounter("SampleCategory", "SampleVoucher", false);

for(int i = 0; i < )
    counter.RawValue = i;    
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License