private void ResetLimit(object sender, ElapsedEventArgs e) { TimerContext context = (TimerContext)sender; context.CanUseCommand = true; context.Stop(); }
public void TimerContext_Start_ContinuesTiming() { TimerContext context = new TimerContext("some-name", new Logger(), LogLevelEnum.LOG_DEBUG); context.Start(); Thread.Sleep(5); context.Stop(); var firstTime = context.GetElapsedTime(); context.Start(); Thread.Sleep(5); context.Stop(); var secondTime = context.GetElapsedTime(); Assert.True(firstTime > 0); Assert.True(secondTime > firstTime); }
public void Stop() => _timerContext.Stop();