Created
September 16, 2019 18:12
-
-
Save rndme/1858443728a59279932796dfcf08078c to your computer and use it in GitHub Desktop.
A browser js timer that won't be suspended when the tab is not active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var worker = new Worker('data:text/javascript,' + escape("setInterval(postMessage.bind(this,0), 1000)")); | |
worker.onmessage=console.info.bind(console); // attach your interval callback here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment