Demo: timeInterval
The timestamp, timeInterval maps the incoming items to objects of type {value: T, interval: R} where the interval shows the time elapsed after the previous emission.
timeInterval();
//Emit items every 1 sec, starting at 0.5 sec
let input = timer(500,1000).pipe(take(6));
//Adds interval showing time elapsed after the previous input
let process = timeInterval();
//Please check the tooltips for the complete output.
//The output on dots are truncated.
let output=input.pipe(process).subscribe(v=>console.log(v))