function punchIn() {
  if (!LAST_LOGGED_HOUR) {
    // When this is the first time we're logging
    LAST_LOGGED_HOUR = getCurrentUTCHourTimestamp();
    NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600;
  } else {
    // Make sure it is time to send the pulse again
    if (!shouldSendPulse) return;
    LAST_LOGGED_HOUR = NEXT_LOGGING_HOUR;
    NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600;
  }
  sendPulse();
  scheduleNextPunchIn();
}
// The next time we should log
The next time we should log
The next time we should log
function punchIn() {
  if (!LAST_LOGGED_HOUR) {
    LAST_LOGGED_HOUR = getCurrentUTCHourTimestamp();
    NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600;
  } else {
    if (!shouldSendPulse) return;
    LAST_LOGGED_HOUR = NEXT_LOGGING_HOUR;
    NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600;
  }
  sendPulse();
  scheduleNextPunchIn();
}
function punchIn ( ) { if ( ! LAST_LOGGED_HOUR ) { LAST_LOGGED_HOUR = getCurrentUTCHourTimestamp ( ) ; NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600 ; } else { if ( ! shouldSendPulse ) return ; LAST_LOGGED_HOUR = NEXT_LOGGING_HOUR ; NEXT_LOGGING_HOUR = LAST_LOGGED_HOUR + 3600 ; } sendPulse ( ) ; scheduleNextPunchIn ( ) ; }
The next time we should log
The next time we should log
// When this is the first time we're logging // Make sure it is time to send the pulse again