I have the following situation:
I have a certain function that runs a loop and does stuff, and error conditions may make it exit that loop. I want to be able to check whether the loop is still running or not.
For this, i'm doing, for each loop run:
LastTimeIDidTheLoop = new Date();
And in another function, which runs through SetInterval every 30 seconds, I want to do basically this:
if (LastTimeIDidTheLoop is more than 30 seconds ago) {
alert("oops");
}
How do I do this?
Thanks!