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; }
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; }