Created
July 14, 2017 18:10
-
-
Save baybatu/56262e145538292982c0960b59cf7f84 to your computer and use it in GitHub Desktop.
a nice spin-wait example in js
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
// Source: https://stackoverflow.com/a/37575602 | |
var waitTill = new Date(new Date().getTime() + seconds * 1000); | |
while(waitTill > new Date()){} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment