Table of Contents

Class Timer

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that generates an observable sequence that periodically produces a value after the specified initial relative due time has elapsed.

Marble diagram

Timer can either generate a single value, if Period is not specified, or an infinite sequence of values emitted periodically. The first value of Timer is emitted after the specified DueTime.

Warning

The value of the DueTime and Period properties cannot be modified after the observable sequence has initialized. If dynamic configuration is necessary, make sure that all properties are immediately configured using property mapping operators.

public class Timer : Source<long>
Inheritance
Timer
Inherited Members

Properties

DueTime

Gets or sets the relative time at which to produce the first value. If this value is less than or equal to Zero, the timer will fire as soon as possible.

public TimeSpan DueTime { get; set; }

Property Value

TimeSpan

Period

Gets or sets the period to produce subsequent values. If this value is equal to Zero the timer will recur as fast as possible.

public TimeSpan Period { get; set; }

Property Value

TimeSpan

Methods

Generate()

Generates an observable sequence that periodically produces a value after the specified initial relative due time has elapsed.

public override IObservable<long> Generate()

Returns

IObservable<long>

An observable sequence of integer values counting how many times the timer has fired.