Skip to content

Instantly share code, notes, and snippets.

@cfausn
Last active February 27, 2025 16:53
Show Gist options
  • Save cfausn/691df3098db0ea51087455a7bbab20fb to your computer and use it in GitHub Desktop.
Save cfausn/691df3098db0ea51087455a7bbab20fb to your computer and use it in GitHub Desktop.
Unanet
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