Skip to content

Scheduler.StartStopwatch(IScheduler) method

Defined in

Type: Scheduler Namespace: System.Reactive.Concurrency Assembly: System.Reactive.dll

Applies to

netstandard2.0

public static IStopwatch StartStopwatch(this IScheduler scheduler)

Summary: Starts a new stopwatch object by dynamically discovering the scheduler's capabilities. If the scheduler provides stopwatch functionality, the request will be forwarded to the stopwatch provider implementation. Otherwise, the stopwatch will be emulated using the scheduler's notion of absolute time.

Parameters

NameTypeDescription
scheduler[IScheduler](#Scheduler to obtain a stopwatch for.

Returns: IStopwatch -- New stopwatch object; started at the time of the request.

Remarks

The resulting stopwatch object can have non-monotonic behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler is null.