I need to refresh simple page every 60second but i need to stop refreshing with specific time.
window.setTimeout(function () {
window.location.reload();
}, 60000);
note: that the time when page refreshing stop in 00:29 and start in 00:31 and like that ...
If you want to refresh EVERY 60 seconds, you should use setInterval() instead of setTimeout(), because setTimeout() only does it once. And for stopping it:
const myInterval = setInterval(() => {
if (/*Your statement*/) {
clearInterval(myInterval)
}
window.location.reload()
}, 60000)