예제 #1
0
 public TimerResult StartTimer(string eventName = null)
 {
     stopwatch.Reset();
     stopwatchCounter = 0;
     var timerResult = new TimerResult {
         FromBeginning = TimeSpan.FromTicks(0),
         SequenceNumber = stopwatchCounter,
         Timestamp = CustomDateTime.Now,
         EventName = eventName
     };
     stopwatch.Start();
     return timerResult;
 }
예제 #2
0
 public TimerResult StopTimer(string eventName = null)
 {
     stopwatchCounter++;
     var timerResult = new TimerResult {
         FromBeginning = stopwatch.Elapsed,
         SequenceNumber = stopwatchCounter,
         Timestamp = CustomDateTime.Now,
         EventName = eventName
     };
     stopwatch.Stop();
     stopwatch.Reset();
     return timerResult;
 }