function updateTimer(hours, minutes, seconds) {
  let displayHours = hours.toString();
  let displayMinutes = minutes.toString();
  let displaySeconds = seconds.toString();
  memorySeconds = seconds;
  memoryMinutes = minutes;
  memoryHours = hours;

  if (displayHours.length < 2) {
    displayHours = "0" + displayHours;
  }
  if (displayMinutes.length < 2) {
    displayMinutes = "0" + displayMinutes;
  }
  if (displaySeconds.length < 2) {
    displaySeconds = "0" + displaySeconds;
  }

  const time = displayHours + ":" + displayMinutes + ":" + displaySeconds;

  const color = getColor(hours, minutes);

  chrome.tabs.executeScript(
      {code: "var currentTime=\"" + time + "\"; var color=\"" + color + "\""},
      function() {
        chrome.tabs.executeScript({
          file: "core/updateUI.js",
        });
      },
  );

  // Stop updating the timer if it reaches 00:00:00
  if (hours == 0 && minutes == 0 && seconds == 0) {
    setTimeout(clearTimer, 1000);
    return;
  }

  const updatedSeconds = updateSeconds(seconds);
  const updatedMinutes = updateMinutes(minutes, seconds < updatedSeconds);
  const updatedHours = updateHours(hours, minutes < updatedMinutes);

  timerHandler = setTimeout(updateTimer, 1000,
      updatedHours, updatedMinutes, updatedSeconds);
}
/**
 * Update the display timer each second
 * Timer is displayed in the format hh:mm:ss
 * @param {Number} hours - hours to be displayed
 * @param {Number} minutes - minutes to be displayed
 * @param {Number} seconds - seconds to be displayed
 */
Update the display timer each second
Timer is displayed in the format hh:mm:ss
@param {Number} hours - hours to be displayed
@param {Number} minutes - minutes to be displayed
@param {Number} seconds - seconds to be displayed
Update the display timer each second Timer is displayed in the format hh : mm : ss @param { Number } hours - hours to be displayed @param { Number } minutes - minutes to be displayed @param { Number } seconds - seconds to be displayed
function updateTimer(hours, minutes, seconds) {
  let displayHours = hours.toString();
  let displayMinutes = minutes.toString();
  let displaySeconds = seconds.toString();
  memorySeconds = seconds;
  memoryMinutes = minutes;
  memoryHours = hours;
  if (displayHours.length < 2) {
    displayHours = "0" + displayHours;
  }
  if (displayMinutes.length < 2) {
    displayMinutes = "0" + displayMinutes;
  }
  if (displaySeconds.length < 2) {
    displaySeconds = "0" + displaySeconds;
  }
  const time = displayHours + ":" + displayMinutes + ":" + displaySeconds;
  const color = getColor(hours, minutes);
  chrome.tabs.executeScript(
      {code: "var currentTime=\"" + time + "\"; var color=\"" + color + "\""},
      function() {
        chrome.tabs.executeScript({
          file: "core/updateUI.js",
        });
      },
  );
  if (hours == 0 && minutes == 0 && seconds == 0) {
    setTimeout(clearTimer, 1000);
    return;
  }
  const updatedSeconds = updateSeconds(seconds);
  const updatedMinutes = updateMinutes(minutes, seconds < updatedSeconds);
  const updatedHours = updateHours(hours, minutes < updatedMinutes);
  timerHandler = setTimeout(updateTimer, 1000,
      updatedHours, updatedMinutes, updatedSeconds);
}
function updateTimer ( hours , minutes , seconds ) { let displayHours = hours . toString ( ) ; let displayMinutes = minutes . toString ( ) ; let displaySeconds = seconds . toString ( ) ; memorySeconds = seconds ; memoryMinutes = minutes ; memoryHours = hours ; if ( displayHours . length < 2 ) { displayHours = "0" + displayHours ; } if ( displayMinutes . length < 2 ) { displayMinutes = "0" + displayMinutes ; } if ( displaySeconds . length < 2 ) { displaySeconds = "0" + displaySeconds ; } const time = displayHours + ":" + displayMinutes + ":" + displaySeconds ; const color = getColor ( hours , minutes ) ; chrome . tabs . executeScript ( { code : "var currentTime=\"" + time + "\"; var color=\"" + color + "\"" } , function ( ) { chrome . tabs . executeScript ( { file : "core/updateUI.js" , } ) ; } , ) ; if ( hours == 0 && minutes == 0 && seconds == 0 ) { setTimeout ( clearTimer , 1000 ) ; return ; } const updatedSeconds = updateSeconds ( seconds ) ; const updatedMinutes = updateMinutes ( minutes , seconds < updatedSeconds ) ; const updatedHours = updateHours ( hours , minutes < updatedMinutes ) ; timerHandler = setTimeout ( updateTimer , 1000 , updatedHours , updatedMinutes , updatedSeconds ) ; }
Update the display timer each second
 Timer is displayed in the format hh:mm:ss
 @param {Number} hours - hours to be displayed
 @param {Number} minutes - minutes to be displayed
 @param {Number} seconds - seconds to be displayed
Update the display timer each second Timer is displayed in the format hh : mm : ss @param { Number } hours - hours to be displayed @param { Number } minutes - minutes to be displayed @param { Number } seconds - seconds to be displayed
// Stop updating the timer if it reaches 00:00:00