Chrome: timeouts/interval suspended in background tabs?

后端 未结 6 1415
清酒与你
清酒与你 2020-11-22 02:47

I was testing the accuracy of setTimeout using this test. Now I noticed that (as expected) setTimeout is not very accurate but for most appliances

6条回答
  •  -上瘾入骨i
    2020-11-22 03:39

    here is my solution which gets the current millisecond, and compares it to the millisecond that the function was created. for interval, it will update the millisecond when it runs the function. you can also grab the interval/timeout by an id.

    
    

提交回复
热议问题