Demo: timestamp
The timestamp maps each input from source observable to an object of type {value: T, timestamp: R}. The timestamp has the value generated using Date.now()
timestamp();
let input = timer(500,1000).pipe(take(6));
//Adds timestamp to each input as discussed above
let process = timestamp();
//Please check the tooltips for the complete output.
//The output on dots are truncated.
let output=input.pipe(process).subscribe(v=>console.log(v))