How can I make setInterval also work when a tab is inactive in Chrome?

后端 未结 13 1956
被撕碎了的回忆
被撕碎了的回忆 2020-11-21 09:59

I have a setInterval running a piece of code 30 times a second. This works great, however when I select another tab (so that the tab with my code becomes inacti

13条回答
  •  无人及你
    2020-11-21 10:43

    Heavily influenced by Ruslan Tushov's library, I've created my own small library. Just add the script in the and it will patch setInterval and setTimeout with ones that use WebWorker.

提交回复
热议问题