Пример #1
0
 //! 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);
     }
 }
Пример #2
0
 //! Build the perf helper, immediately start the counter
 public PerfHelper(String name)
 {
     if (PerfStats.IsActive())
     {
         _strName  = name;
         stopwatch = Stopwatch.StartNew();
     }
 }