• Well,

    I usually prefer a construction like

    var Interval = 1000;
    setTimeout(()=>{
      draw();
    }, Interval - (Date.now() % Interval));
    

    if

    • (calculation and) drawing may take longer than 1000ms (should be
      rare) or
    • the Interval may change dynamically (e.g. depending on screen lock)

    But, most often, a simple setInterval should be sufficient.

About