function scheduleNextPunchIn() {
  const timestamp = getCurrentUTCTimestamp();
  const startListentingIn = NEXT_LOGGING_HOUR - timestamp - 2;

  // If we don't have much time until TTL expires;
  // Don't bother removing listener
  if (startListentingIn <= 10) return;

  // Remove all listeners for now.
  removeActivityListener();

  // Add listeners 2 seconds before the next hour begins
  setTimeout(addActivityListener, startListentingIn * 1000);
}
// Removes event listeners and adds them just in time for the next pulse
Removes event listeners and adds them just in time for the next pulse
Removes event listeners and adds them just in time for the next pulse
function scheduleNextPunchIn() {
  const timestamp = getCurrentUTCTimestamp();
  const startListentingIn = NEXT_LOGGING_HOUR - timestamp - 2;
  if (startListentingIn <= 10) return;
  removeActivityListener();
  setTimeout(addActivityListener, startListentingIn * 1000);
}
function scheduleNextPunchIn ( ) { const timestamp = getCurrentUTCTimestamp ( ) ; const startListentingIn = NEXT_LOGGING_HOUR - timestamp - 2 ; if ( startListentingIn <= 10 ) return ; removeActivityListener ( ) ; setTimeout ( addActivityListener , startListentingIn * 1000 ) ; }
Removes event listeners and adds them just in time for the next pulse
Removes event listeners and adds them just in time for the next pulse
// If we don't have much time until TTL expires; // Don't bother removing listener // Remove all listeners for now. // Add listeners 2 seconds before the next hour begins