Rx.Observable.prototype.timestamp([scheduler])
Records the timestamp for each value in an observable sequence.
Arguments
[scheduler=Rx.Observable.timeout]
(Scheduler
): Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.
Returns
(Observable
): An observable sequence with timestamp information on values.
Example
var source = Rx.Observable.timer(0, 1000)
.timestamp()
.map(function (x) { return x.value + ':' + x.timestamp; })
.take(5);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 0:1378690776351
// => Next: 1:1378690777313
// => Next: 2:1378690778316
// => Next: 3:1378690779317
// => Next: 4:1378690780319
// => Completed
Location
File:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: