We have a use case of running the java script thread once a month. But what we observe is if we provide 3.5 weeks of delay for the setinterval function it does not respect it and starts getting scheduling once a second. is it a bug? does it have any maxiumum limit for giving the delay?
Interestingly same works fine for setTimeOut. -
<!DOCTYPE html>
<html>
<body>
<input type="text" id="clock" />
<script>
var int=setInterval(function(){clock()},1000*60*60*24*7*3.5);
function clock()
{
var d=new Date();
var t=d.toLocaleTimeString();
document.getElementById("clock").value=t;
}
</script>
<button onclick="int=window.clearInterval(int)">Stop</button>
</body>
</html>
clockinstead offunction(){clock()}.