I’m trying to use setTimeout. I want it to execute every five seconds but not immediately when setTimeout is called. I can’t get it to work:
firsttime = true;
window.setTimeout(function () {
if (!firsttime) {
window.location.reload();
}
firsttime = false;
}, 5 * 1000);
setTimeoutonly runs once.setIntervalruns every X milliseconds.