I'm currently developing a JavaScript cronometer in vueJS. I want the timer to start at 5 minutes (300 seconds) and then continue counting minutes and seconds.
Although my cronometer is functioning, I am struggling to get it to start counting minutes after reaching 300 seconds.
// Declaring variables for tracking time after the initial 5 minutes.
let sec= 0, min = 0, hour = 0;
// Counting up to 5 minutes
let startMin = 5*60, cronometro = 0;
cronometro = setInterval(function (){
if(cronometro >= startMin){
sec++;
if(sec == 60){
min++;
sec = 0;
if(min == 60){
hour++;
min = 0;
}
}
}
minutos.innerHTML = min
}, 1000);