Class TimerSystemImplementationBase<T>
A base for timer system implementations which supplies the scheduling, leaving a derived type to supply only the clock.
[PublicAPI]
public abstract class TimerSystemImplementationBase<T> : ITimerSystemImplementation<T> where T : IComparable
Type Parameters
TThe type used to express a point in time.
- Inheritance
-
TimerSystemImplementationBase<T>
- Implements
- Inherited Members
- Extension Methods
Remarks
Derive from this and write Now and SubtractTimes(T, T). The This type puts the timers in order, waits, and fires them. SystemClockTimerSystem and SecondsTimerSystem are the two implementations that ship.
Properties
- Now
Gets the current time according to this implementation's clock.
Methods
- RunTimersTo(T)
Fires each timer scheduled at or before
now, on the calling thread.
- SetTimer(T, Action)
Schedules
callbackto run when the clock reachestime.
- Start(Action<Exception>)
Starts whatever machinery this implementation uses to notice that a timer has come due.
- SubtractTimes(T, T)
Returns how much time separates two points on this implementation's clock.