You are technically fine. If you really want this, you can have a waiting time of up to 24.8611 days !!! . setTimeout can reach 2147483647 milliseconds (maximum for a 32-bit integer and about 24 days), but if it is higher, you will see unexpected behavior. See Why setTimeout () "break" for large delay values ββin milliseconds?
For intervals, such as polling, I recommend using setInterval instead of the recursive setTimeout. setInterval does exactly what you want for the survey, and you have more control. Example. To stop the interval at any time, be sure to keep the return value of setInterval, for example:
var guid = setInterval(function(){console.log("running");},1000) ;
source share