var myVar = uncontrollableNumber;
$("#myButton").click(function(){
myVar++;
});
Is there a way that I can check that "if myVar doesn't change (can go up or down, code is just an example) in 20 seconds, do something, and if it does change, restart countdown"? I have tried some code but failed.
function myFunction(myVar){
var oldMyVar = myVar;
while(oldMyVar === myVar){
var countdownDone = false;
//countdown then run function
countdownDone = true;
}
if(!countdownDone){
myFunction();
}