Published
Edited
Jul 27, 2022
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
perf = {
let ds = [performance.now()];
while (ds.at(-1) - ds[0] < 10) {
ds.push(performance.now());
}
return ds;
}
Insert cell
date = {
let ds = [+new Date()];
while (ds.at(-1) - ds[0] < 10) {
ds.push(+new Date());
}
return ds;
}
Insert cell
combined = {
let startPerf = performance.now();
let startDate = +new Date();
let ds = [
{ type: "performance.now()", value: 0 },
{ type: "new Date()", value: 0 }
];
while (ds.at(-2).value < 10) {
ds.push({
type: "performance.now()",
value: performance.now() - startPerf
});
ds.push({ type: "new Date()", value: +new Date() - startDate });
}
return ds;
}
Insert cell
color = ({
domain: ["performance.now()", "new Date()"],
range: ["blue", "red"],
legend: true
})
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