function check() {
    const now = new Date(),
      h = now.getHours(), m = now.getMinutes(),
      s = now.getSeconds(), ms = now.getMilliseconds();
    if (h!==lastHour && m===0) chime();
    lastHour = h;
    // check again when this hour is over
    const mLeft = 60-m, sLeft = (mLeft*60)-s, msLeft = (sLeft*1000)-ms;
    setTimeout(check, msLeft);
  }
// don't chime when (re)loaded at a whole hour
don't chime when (re)loaded at a whole hour
don ' t chime when ( re ) loaded at a whole hour
function check() {
    const now = new Date(),
      h = now.getHours(), m = now.getMinutes(),
      s = now.getSeconds(), ms = now.getMilliseconds();
    if (h!==lastHour && m===0) chime();
    lastHour = h;
    const mLeft = 60-m, sLeft = (mLeft*60)-s, msLeft = (sLeft*1000)-ms;
    setTimeout(check, msLeft);
  }
function check ( ) { const now = new Date ( ) , h = now . getHours ( ) , m = now . getMinutes ( ) , s = now . getSeconds ( ) , ms = now . getMilliseconds ( ) ; if ( h !== lastHour && m === 0 ) chime ( ) ; lastHour = h ; const mLeft = 60 - m , sLeft = ( mLeft * 60 ) - s , msLeft = ( sLeft * 1000 ) - ms ; setTimeout ( check , msLeft ) ; }
don't chime when (re)loaded at a whole hour
don ' t chime when ( re ) loaded at a whole hour
// check again when this hour is over