var timerId = setInterval(function(){ if(window.document.drops.isFinished()){ clearInterval(timerId); } },1000);
If if this is not the last in the function and you want to βsplitβ the execution, you might also want to add a return; after clearInterval .
source share