public IOThreadTimer(Action <object> callback, object callbackState, bool isTypicallyCanceledShortlyAfterBeingSet, int maxSkewInMilliseconds) { this.callback = callback; this.callbackState = callbackState; this.maxSkew = Ticks.FromMilliseconds(maxSkewInMilliseconds); this.timerGroup = isTypicallyCanceledShortlyAfterBeingSet ? TimerManager.Value.VolatileTimerGroup : TimerManager.Value.StableTimerGroup; }
public IOThreadTimer(Action <object> callback, object callbackState, bool isTypicallyCanceledShortlyAfterBeingSet, int maxSkewInMilliseconds) { IOThreadTimer.TimerGroup volatileTimerGroup; this.callback = callback; this.callbackState = callbackState; this.maxSkew = Ticks.FromMilliseconds(maxSkewInMilliseconds); IOThreadTimer oThreadTimer = this; if (isTypicallyCanceledShortlyAfterBeingSet) { volatileTimerGroup = IOThreadTimer.TimerManager.Value.VolatileTimerGroup; } else { volatileTimerGroup = IOThreadTimer.TimerManager.Value.StableTimerGroup; } oThreadTimer.timerGroup = volatileTimerGroup; }
public void Set(int millisecondsFromNow) { SetAt(Ticks.Add(Ticks.Now, Ticks.FromMilliseconds(millisecondsFromNow))); }