For some reason the window.setInterval thing stops working after about 60 seconds if its window is not visible enough.
Does anybody know how I can make it continue until I tell it to stop?
Here is a simple demo. I run it in chrome a web site, it does not stop in the VS debug environment.
function pseudoBot2() {
const startTime = new Date();
startTimeMs = startTime.getTime();
const funcId = setInterval(logIt, 1000);
}
function logIt(){
const now = new Date();
const elapsed = now.getTime() - startTimeMs;
console.log("TX at " + Math.round(elapsed / 1000));
}
If you start it with the chrome debugger console on then minimise its window then maximise after about 2 minutes the console log contains something like
.
.
TX at 61
TX at 62
TX at 63
TX at 105
TX at 165
.
.