i need to restart a setTimeout
after stopping it with a clearTimeout
the code is like:
function start(){timeout = setTimeout(function(){...}, 1000}
function increment(){interval();}
function stop(){clearTimeout(timeout)}
better explained:
function start()
is a timeout of 1000ms for another function that recall start()
.
function increment()
just add +1 to a value every 1000s but it doesn't matter with the problem.
the last function stop()
stops the setTimeout
in the function start()
.
i need to stop the setTimeout
in start()
for just 1000ms and then let it continue working.