Public
Edited
Oct 26, 2023
Insert cell
Insert cell
async function counter() {
//send notification for every 10, 20seconds

let a = performance.now();
await new Promise((resolve) => setTimeout(resolve, 1000));
return performance.now() - a;
}
Insert cell
counter()
Insert cell
async function* counter_generator() {
let counter = 1;
while (true) {
let a = performance.now();
await new Promise((resolve) => setTimeout(resolve, 1000));
counter += 1;
yield counter;
}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more