Well,
I usually prefer a construction like
var Interval = 1000; setTimeout(()=>{ draw(); }, Interval - (Date.now() % Interval));
if
Interval
But, most often, a simple setInterval should be sufficient.
setInterval
@Andreas_Rozek started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well,
I usually prefer a construction like
if
rare) or
Interval
may change dynamically (e.g. depending on screen lock)But, most often, a simple
setInterval
should be sufficient.