You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • I played around with the time on my phone, but it didnĀ“t stop the clock.
    BTW: Why do all clocks seem to use timeouts instead of intervals to update? I just changed

    function queueDraw() {
      if (drawTimeout) clearTimeout(drawTimeout);
      drawTimeout = setTimeout(function() {
        drawTimeout = undefined;
        draw();
        queueDraw();
      }, 60000 - (Date.now() % 60000));
    }
    

    to

    setInterval(draw,60000);
    
    

    , which seems to do exactly the same.

  • which seems to do exactly the same.

    no, this is not synced to real time so you may draw next minute too late

  • Sure but in practice does anyone care if the clock face updates 1s too late once per minute. Maybe the actual difference is 100ms sometimes? Or are there scenarios that could mean a noticeable difference?

About

Avatar for fanoush @fanoush started