ReactiveUI.Primitives.Concurrency.VirtualTimeSequencer<TAbsolute, TRelative>
public sealed class VirtualTimeSequencer<TAbsolute, TRelative> : ISequencer, IServiceProvider, IStopwatchProvider where TAbsolute : IComparable<TAbsolute>
Virtual time scheduler that runs scheduled work against a controllable clock. Per-clock arithmetic is supplied
as delegates at construction, so a single sealed type serves every TAbsolute/
TRelative pairing without an inheritance hierarchy.
Gets the scheduler's absolute time clock value.
Gets a value indicating whether the scheduler is enabled to run work.
public VirtualTimeSequencer(TAbsolute initialClock, IComparer<TAbsolute> comparer, Func<TAbsolute, TRelative, TAbsolute> add, Func<TAbsolute, DateTimeOffset> toDateTimeOffset, Func<TimeSpan, TRelative> toRelative)
Initializes a new instance of the VirtualTimeSequencer<T, U> class.
Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
Advances the scheduler's clock to the specified time, running all work till that point.
Schedules an action to be executed at the current clock.
public IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<ISequencer, TState, IDisposable> action)
Schedules an action to be executed after a relative due time.
public IDisposable Schedule<TState>(TState state, DateTimeOffset dueTime, Func<ISequencer, TState, IDisposable> action)
Schedules an action to be executed at an absolute date-time.
public IDisposable ScheduleAbsolute<TState>(TState state, TAbsolute dueTime, Func<ISequencer, TState, IDisposable> action)
Schedules an action to be executed at an absolute due time.
public IDisposable ScheduleRelative<TState>(TState state, TRelative dueTime, Func<ISequencer, TState, IDisposable> action)
Schedules an action to be executed after a relative due time.
Advances the scheduler's clock by the specified relative time without running work.
Starts the virtual time scheduler.
Starts a new stopwatch object.
Stops the virtual time scheduler.