Public
Edited
Jul 31, 2023
Insert cell
Insert cell
live = true
Insert cell
fps = 60
Insert cell
interval = 1000 / fps
Insert cell
mutable timer = undefined
Insert cell
Insert cell
function onTick () {}
Insert cell
function onRealTick () {
onTick()

doTimer()
}
Insert cell
setTimeout(() => {
doTimer();
}, interval)
Insert cell
function doTimer (ticksPerMinute) {

if (!mutable timer && live) {
mutable timer = setTimeout(onRealTick, interval)
}

return mutable timer
}
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