-
Notifications
You must be signed in to change notification settings - Fork 8
delay
richardszalay edited this page May 20, 2011
·
8 revisions
Delays values from the source by a specified amount of time.
function delay(delayMs : uint) : IObservable.<T>
Each value emitted by the source will emitted after delayMs milliseconds.
The returned sequence completes when the source sequence completes.
The returned sequence errors when the source sequences errors.
xs = source
ys = output
xs ──o─────o─────o─────/
│ └───┐ └───┐ └───┐
│ delayMs │ │ │
└────────┐└────┐└────┐└────┐
│ │ │ │
ys ───────────o─────o─────o─────/
IObservable.<T>
var source : IObservable = Observable.range(0, 5)
.delay(1000);
source.subscribe(function(value : int) : void
{
trace(value);
});
// Trace output is:
// 0 (@ 00:00:01)
// 1 (@ 00:00:02)
// 2 (@ 00:00:03)
// 3 (@ 00:00:04)
// 4 (@ 00:00:05)