-
Notifications
You must be signed in to change notification settings - Fork 8
interval
richardszalay edited this page May 20, 2011
·
12 revisions
Creates an unending observable sequence of integers that are incremented at intervalMs (in milliseconds).
static function interval(intervalMs : uint, scheduler : IScheduler = null)
The returned sequence does not complete
The returned sequence does not error
│intervalMs│intervalMs│intervalMs│
───────────o──────────o──────────o──────────o──>
0 1 2 ... ∞
Unless specified, this operator uses Scheduler.synchronous
.
IObservable.<int>
Observable.interval(1000)
.subscribe(function(index : int) : void
{
trace("1 second has elapsed (" (index+1).toString() + " total)");
});
// Trace output is:
// 1 second has elapsed (1 total)
// 1 second has elapsed (2 total)
// 1 second has elapsed (3 total)
// 1 second has elapsed (4 total)
// ...