js/app.js
/**
 * Starts the time and updates back under timer section of the page
 */
Starts the time and updates back under timer section of the page
Starts the time and updates back under timer section of the page
function startTime() {
    s++;
    if (s > 59) {
        s = 0;
        m++;
    }
    if (m > 59) {
        m = 0;
        h++;
    }
    if (h > 23) { 
        s = 0;
        m = 0;
        h = 0;
    }
    document.querySelector('.timer').textContent =
        formatTimeElement(h) + ":" + formatTimeElement(m) + ":" + formatTimeElement(s);
    t = setTimeout(startTime, 1000);
}
function startTime ( ) { s ++ ; if ( s > 59 ) { s = 0 ; m ++ ; } if ( m > 59 ) { m = 0 ; h ++ ; } if ( h > 23 ) { s = 0 ; m = 0 ; h = 0 ; } document . querySelector ( '.timer' ) . textContent = formatTimeElement ( h ) + ":" + formatTimeElement ( m ) + ":" + formatTimeElement ( s ) ; t = setTimeout ( startTime , 1000 ) ; }
Starts the time and updates back under timer section of the page
Starts the time and updates back under timer section of the page
//rare to happen but included for completeness and to handle the situation in case it happens