Last active
February 5, 2024 21:07
-
-
Save Julianhm9612/528da901b45a4251e16aac3d31992fa7 to your computer and use it in GitHub Desktop.
Sleep
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 (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
// Sleep a second | |
sleep(1000).then(() => { | |
// Code to run after | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment