【发布时间】:2012-03-06 14:15:31
【问题描述】:
我使用以下代码创建了一个自定义性能计数器:
public class PerfCounter
{
private PerformanceCounter perfCounter;
PerfCounter(string CategoryName, string CounterName)
{
perfCounter = new PerformanceCounter(CategoryName, CounterName, false);
perfCounter.BeginInit();
}
public void IncrementBy(long value)
{
perfCounter.IncrementBy(value);
}
public void Reset()
{
//what should I add here?
}
}
一切正常,但我不知道如何重置计数器。谁能帮帮我?
【问题讨论】:
-
也许这会有所帮助? stackoverflow.com/questions/9195851/…
标签: c# visual-studio-2010 performancecounter