Skip to content

Instantly share code, notes, and snippets.

@Julianhm9612
Last active February 5, 2024 21:07
Show Gist options
  • Save Julianhm9612/528da901b45a4251e16aac3d31992fa7 to your computer and use it in GitHub Desktop.
Save Julianhm9612/528da901b45a4251e16aac3d31992fa7 to your computer and use it in GitHub Desktop.
Sleep
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