-
-
Save josephwegner/7763301 to your computer and use it in GitHub Desktop.
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
//Or, if you don't want messy code every time, just define an instaInterval function | |
function instaInterval(f, t) { | |
return (function() { | |
f(); | |
return setInterval(f, t); | |
}); | |
} | |
//And now create executable intervals on the fly | |
var interval = instaInterval(function() { | |
console.log("This is possible the best version of setInterval"); | |
}, 5000) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment