<PackageReference Include="System.Reactive" Version="5.0.0" />

LocalScheduler

Abstract base class for machine-local schedulers, using the local system clock for time-based operations.
public virtual DateTimeOffset Now { get; }

Gets the scheduler's notion of current time.

protected LocalScheduler()

Creates a new local scheduler.

protected virtual object GetService(Type serviceType)

Discovers scheduler services by interface type. The base class implementation returns requested services for each scheduler interface implemented by the derived class. For more control over service discovery, derived types can override this method.

public virtual IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)

Schedules an action to be executed.

public abstract IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)

Schedules an action to be executed after dueTime.

public virtual IDisposable Schedule<TState>(TState state, DateTimeOffset dueTime, Func<IScheduler, TState, IDisposable> action)

Schedules an action to be executed at dueTime.

public virtual IStopwatch StartStopwatch()

Starts a new stopwatch object.