There is a timer that counts the minute.
There are buttons "pause", "start again" and "continue".
The first and second work, but the latter does not work.
Tell me where to dig?

if(channel == 'stopTimer') { timer_on = false; return; } if(channel == 'continueTimer') { timer_on = true; return; } if (channel == 'AddTime') { timer_on = false; setTimeout(function () { timer_on = true; startTimer(TimeToAdd * 60); }, 1e3); return; } 

Here is the function itself:

 function startTimer(time) { TimerProcceed = true; var time_def = time; var timer = setInterval(function() { if(timer_on == true) { time--; postTime(time, time_def); } }, 1000); } 

    1 answer 1

    You need to rewrite the function, the timer itself cannot be paused, you can only start the report from the beginning. It is possible to pass the parameter how much time has passed since the start of the timer and start the timer based on this data.