I usually prefer a construction like
var Interval = 1000;
}, Interval - (Date.now() % Interval));
But, most often, a simple setInterval should be sufficient.
© Espruino, powered by microcosm.
Report a problem