I have the following situation:
I have a specific function that starts a loop and makes stuff, and error conditions can make it exit this loop. I want to check if everything is working cycle or not.
For this, I do for each cycle:
LastTimeIDidTheLoop = new Date();
And in another function that passes through SetInterval every 30 seconds, I want to do basically this:
if (LastTimeIDidTheLoop is more than 30 seconds ago) {
alert("oops");
}
How to do it?
Thanks!
source
share