Public
Edited
Oct 14, 2022
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ms("1d")
Insert cell
Insert cell
Insert cell
ms(12345678)
Insert cell
Insert cell
Insert cell
Insert cell
ms(12345678, { long: true })
Insert cell
Insert cell
ms = (await import("https://cdn.skypack.dev/ms@2.1.3?min")).default
Insert cell
Insert cell
exampleMsExact = {
let rem, hours, minutes, seconds;
[hours, rem] = intFrac(exampleMs / ms("1h"));
[minutes, rem] = intFrac(rem * 60);
[seconds, rem] = intFrac(rem * 60);
return { hours, minutes, seconds, ms: Math.round(rem * 1000) };
}
Insert cell
intFrac = (n) => {
let int = Math.floor(n);
return [int, n - int];
}
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