Skip to content

VirtualTimeSequencer class

Attributes: [DebuggerDisplay("{DebuggerDisplay,nq}")]

Defined in

Namespace: ReactiveUI.Primitives.Concurrency Assembly: ReactiveUI.Primitives.dll Full name: ReactiveUI.Primitives.Concurrency.VirtualTimeSequencer<T1, T2> Modifiers: public sealed

Summary

View source

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.

Applies to

net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-desktop1.0, net9.0-browserwasm1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net481, net471, net462

Class hierarchy
classDiagram
class VirtualTimeSequencer~T1,T2~
class ISequencer {
    <>
}
ISequencer <|.. VirtualTimeSequencer~T1,T2~
class IServiceProvider {
    <>
}
IServiceProvider <|.. VirtualTimeSequencer~T1,T2~
class IStopwatchProvider {
    <>
}
IStopwatchProvider <|.. VirtualTimeSequencer~T1,T2~

Implements: ISequencer, IServiceProvider, IStopwatchProvider

Constructors

NameSummary
.ctorInitializes a new instance of the [VirtualTimeSequencer](# class.

Properties

NameSummary
ClockGets the scheduler's absolute time clock value.
IsEnabledGets a value indicating whether the scheduler is enabled to run work.
NowGets the scheduler's notion of current time.
TimestampGets the sequencer's monotonic timestamp.

Methods

NameSummary
AdvanceByAdvances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
AdvanceToAdvances the scheduler's clock to the specified time, running all work till that point.
SleepAdvances the scheduler's clock by the specified relative time without running work.
StartStarts the virtual time scheduler.
StopStops the virtual time scheduler.
ScheduleSchedules a work item for execution as soon as possible.
ScheduleAbsoluteSchedules an action to be executed at an absolute due time.
ScheduleRelativeSchedules an action to be executed after a relative due time.
StartStopwatchStarts a new stopwatch object.
Inherited members