In my current website I'm trying to make a cookie clicker type game... But when I run the collector for currency per second it slows down when I switch tabs...
Here is the script:
setInterval(ppsCollector,16.6666666667);
function ppsCollector() {
var ppf = pps / 60;
pounds += ppf;
document.getElementById("poundCount").innerHTML = metricAbbreviate(pounds);
document.getElementById("pps").innerHTML = metricAbbreviate(pps);
}
Is there any way to run this at the same rate when out of focus?
Thanks for all help in advance. :)