Skip to content

Instantly share code, notes, and snippets.

@enricopolanski
Created January 29, 2018 23:48
Show Gist options
  • Save enricopolanski/f9a7e320b4dd7949f783e7a418c31b63 to your computer and use it in GitHub Desktop.
Save enricopolanski/f9a7e320b4dd7949f783e7a418c31b63 to your computer and use it in GitHub Desktop.
let timer = 1500;
let startTimer = function(){
if (timer !== 0){
timer -= 1;
timerToTime();
} else{
timer = 1500;
window.clearTimeout(timeoutID);
}
}
let timeoutID = window.setTimeout(startTimer, 1000);
pomodoroStartButton.onclick = function(){
startTimer();
}
pomodoroStopButton.onclick = function(){
window.clearTimeout(timeoutID);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment