let count = 60;
function timeLeft(){
count = count - 1;
if(count == 0){
count = 60;
}
}
setInterval(() => timeLeft(), 1000)
setInterval(() => machoAirline.changePrice(), 60000);
setInterval(() => yenoTech.changePrice(), 60000);
This code is the countdown for showing how much time is left until stocks' prices change. But after some minutes, there is a gap between counter and prices update.
console:
price updated!
counter: 42
What's the problem?