Пример #1
0
 public IntervalTimer(float interval, bool shouldInvokeOnStart = false, ITimeGetter timeGetter = null)
 {
     _interval            = interval;
     _stopWatch           = new StopWatch(timeGetter);
     IsRunning            = false;
     _shouldInvokeOnStart = shouldInvokeOnStart;
 }
Пример #2
0
        public ChartController(ITimerAccess timerAccess, ITimeBuilder timeBuilder, ITimeGetter timeGetter, IRequestReader requestReader, ITimerCalculator timerCalculator)
        {
            _timerAccess     = timerAccess;
            _timeBuilder     = timeBuilder;
            _timeGetter      = timeGetter;
            _requestReader   = requestReader;
            _timerCalculator = timerCalculator;

            _timeZoneInfo = _timeBuilder.GetTimeZoneInfo(_requestReader.Read(TypeScript.HttpHeaders.Request.CurrentTimeZone));
        }
Пример #3
0
 public StopWatch(ITimeGetter timeGetter = null)
 {
     IsRunning   = false;
     _timeGetter = timeGetter ?? DefaultTimeGetter.Instance;
 }
Пример #4
0
 public PausableStopWatch(ITimeGetter timeGetter)
 {
     _runWatch   = new StopWatch(timeGetter);
     _pauseWatch = new StopWatch(timeGetter);
 }
Пример #5
0
 public TimeBuilder(ITimeGetter timeGetter)
 {
     _timeGetter = timeGetter;
 }
Пример #6
0
 public ExpirationTimer(float time, ITimeGetter timeGetter = null)
 {
     _intervalTimer              = new IntervalTimer(time, false, timeGetter);
     _intervalTimer.OnTickTimer += TimerTick;
 }
Пример #7
0
 public void Setup()
 {
     _timeGetter = Substitute.For <ITimeGetter>();
     _sut        = new TimeBuilder(_timeGetter);
 }