Created
October 4, 2019 19:39
-
-
Save behnammodi/7418b44cd992f98db63090241924c41f 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
function sleep(seconds) { | |
const startTime = new Date(); | |
const endTime = startTime.setSeconds(startTime.getSeconds() + seconds); | |
while (new Date() < endTime) { | |
continue; | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment