Created
May 12, 2023 23:02
-
-
Save liddiard/dcdf661d03b5516b50da1cf3ac95885e to your computer and use it in GitHub Desktop.
One-liner sleep function to use in JavaScript with async/await
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
const sleep = s => new Promise(r => setTimeout(r, s*1000)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment