Skip to content

ObservableAsync.Timer(TimeSpan) method

Defined in

Type: ObservableAsync Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.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, net462, net481

Overloads

  • 1. public static IObservableAsync<long> Timer(TimeSpan dueTime)
  • 2. public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeProvider? timeProvider)
  • 3. public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeSpan period)
  • 4. public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeSpan period, TimeProvider? timeProvider)

1. Overload

public static IObservableAsync<long> Timer(TimeSpan dueTime)

View source

Summary: Creates an observable sequence that produces a single value (0) after the specified delay, then completes.

Parameters

NameTypeDescription
dueTimeTimeSpanThe time span after which to produce the value. Must be non-negative.

Returns: IObservableAsync -- An observable sequence that produces a single value after the specified delay and then completes.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative.

2. Overload

public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeProvider? timeProvider)

View source

Summary: Creates an observable sequence that produces a single value (0) after the specified delay, then completes.

Parameters

NameTypeDescription
dueTimeTimeSpanThe time span after which to produce the value. Must be non-negative.
timeProviderTimeProvider?An optional time provider for controlling timing. If null, System is used.

Returns: IObservableAsync -- An observable sequence that produces a single value after the specified delay and then completes.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative.

3. Overload

public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeSpan period)

View source

Summary: Creates an observable sequence that produces a single value (0) after the specified delay, then continues to produce sequential values at each specified period.

Parameters

NameTypeDescription
dueTimeTimeSpanThe initial delay before the first value is produced. Must be non-negative.
periodTimeSpanThe interval between subsequent values after the initial delay. Must be positive.

Returns: IObservableAsync -- An observable sequence that produces values starting after the initial delay and continuing at the specified period.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or period is non-positive.

4. Overload

public static IObservableAsync<long> Timer(TimeSpan dueTime, TimeSpan period, TimeProvider? timeProvider)

View source

Summary: Creates an observable sequence that produces a single value (0) after the specified delay, then continues to produce sequential values at each specified period.

Parameters

NameTypeDescription
dueTimeTimeSpanThe initial delay before the first value is produced. Must be non-negative.
periodTimeSpanThe interval between subsequent values after the initial delay. Must be positive.
timeProviderTimeProvider?An optional time provider for controlling timing. If null, System is used.

Returns: IObservableAsync -- An observable sequence that produces values starting after the initial delay and continuing at the specified period.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionThrown if dueTime is negative or period is non-positive.