function updateTimer() { var seconds = convertToSeconds(); window.timer = setInterval(function() { seconds = seconds - 1; initializeTimer(seconds); }, 1000); }