//! Stop the counter (it cannot be started again), add info in PerfStats public void Stop() { if (stopwatch != null && stopwatch.IsRunning) { stopwatch.Stop(); PerfStats.AddCall(_strName, stopwatch.Elapsed); } }
//! Build the perf helper, immediately start the counter public PerfHelper(String name) { if (PerfStats.IsActive()) { _strName = name; stopwatch = Stopwatch.StartNew(); } }