TIL the browser will grind your JavaScript to a crawl when the browser window isn’t active.
function sayHi() {
var hi = document.createTextNode(new Date() + " Hi there!\n");
document.getElementById("greetings").appendChild(hi);
}
setInterval(sayHi, 5000);
In my tests, Chrome will call it once a minute, whereas Firefox calls it twice a minute. Both are far away from the 5 seconds I thought I was getting 😃
#javascript #chrome #firefox #webdev