Last active
February 27, 2025 16:53
-
-
Save cfausn/691df3098db0ea51087455a7bbab20fb to your computer and use it in GitHub Desktop.
Unanet
This file contains hidden or 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 idle(seconds) { | |
return new Promise(resolve => setTimeout(resolve, seconds * 1000)); | |
} | |
async function example() { | |
console.log("Starting..."); | |
await idle(2); // Waits for 2 seconds | |
console.log("Done!"); | |
} | |
example(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment