web/public/obj/js/updateLoop.js
2023-10-16 01:36:02 +02:00

15 lines
353 B
JavaScript

window.updateLoop = [];
(() => {
let updLoop = setInterval(() => {
updateLoop.forEach(f => f());
}, 15000);
let everythingLoaded = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
clearInterval(everythingLoaded);
updateLoop.forEach(f => f());
}
}, 10);
})();