Observable.Timer(TimeSpan) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<long> Timer(TimeSpan dueTime) - 2.
public static IObservable<long> Timer(DateTimeOffset dueTime) - 3.
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period) - 4.
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period) - 5.
public static IObservable<long> Timer(TimeSpan dueTime, IScheduler scheduler) - 6.
public static IObservable<long> Timer(DateTimeOffset dueTime, IScheduler scheduler) - 7.
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler) - 8.
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler)
1. Overload¶
public static IObservable<long> Timer(TimeSpan dueTime)
Summary: Returns an observable sequence that produces a single value after the specified relative due time has elapsed.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | TimeSpan | Relative time at which to produce the value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. |
Returns: IObservable
2. Overload¶
public static IObservable<long> Timer(DateTimeOffset dueTime)
Summary: Returns an observable sequence that produces a single value at the specified absolute due time.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | DateTimeOffset | Absolute time at which to produce the value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. |
Returns: IObservable
3. Overload¶
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period)
Summary: Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | TimeSpan | Relative time at which to produce the first value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. |
period | TimeSpan | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | period is less than TimeSpan.Zero. |
4. Overload¶
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period)
Summary: Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | DateTimeOffset | Absolute time at which to produce the first value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. |
period | TimeSpan | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | period is less than TimeSpan.Zero. |
5. Overload¶
public static IObservable<long> Timer(TimeSpan dueTime, IScheduler scheduler)
Summary: Returns an observable sequence that produces a single value after the specified relative due time has elapsed, using the specified scheduler to run the timer.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | TimeSpan | Relative time at which to produce the value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. |
scheduler | [IScheduler](# | Scheduler to run the timer on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | scheduler is null. |
6. Overload¶
public static IObservable<long> Timer(DateTimeOffset dueTime, IScheduler scheduler)
Summary: Returns an observable sequence that produces a single value at the specified absolute due time, using the specified scheduler to run the timer.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | DateTimeOffset | Absolute time at which to produce the value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. |
scheduler | [IScheduler](# | Scheduler to run the timer on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | scheduler is null. |
7. Overload¶
public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler)
Summary: Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | TimeSpan | Relative time at which to produce the first value. If this value is less than or equal to TimeSpan.Zero, the timer will fire as soon as possible. |
period | TimeSpan | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
scheduler | [IScheduler](# | Scheduler to run timers on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | period is less than TimeSpan.Zero. |
| System.ArgumentNullException | scheduler is null. |
8. Overload¶
public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler)
Summary: Returns an observable sequence that periodically produces a value starting at the specified initial absolute due time, using the specified scheduler to run timers.
Parameters
| Name | Type | Description |
|---|---|---|
dueTime | DateTimeOffset | Absolute time at which to produce the first value. If this value is less than or equal to DateTimeOffset.UtcNow, the timer will fire as soon as possible. |
period | TimeSpan | Period to produce subsequent values. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible. |
scheduler | [IScheduler](# | Scheduler to run timers on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | period is less than TimeSpan.Zero. |
| System.ArgumentNullException | scheduler is null. |