Наследование: IDisposable
Пример #1
0
 public static TimeSpan Time (string opName, Action action)
 {
     var mark = new Benchmark (opName).Start ();
     action ();
     mark.Stop ();
     logger.Info (mark.ToString ());
     return mark.Elapsed;
 }
Пример #2
0
 public static TimeSpan Time (string opName, Action action, int loopCount, bool warmup)
 {
     if (warmup)
         action ();
     var mark = new Benchmark (opName).Start ();
     for (var i = 0; i < loopCount; i++)
         action ();
     mark.Stop ();
     logger.Info (String.Format ("Timing for {0} run {1} times:\t {1}", opName, loopCount, mark.Elapsed));
     return mark.Elapsed;
 }