Created
May 15, 2023 03:54
-
-
Save Tribhuwan-Joshi/3d8fe7342ef5f760f46088091d07cbd6 to your computer and use it in GitHub Desktop.
Leetcode JS
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
async function sleep(millis){ | |
return new Promise(res => setTimeout(res,millis) ) // return a promise that will resolve after millis milliseconds | |
} | |
const t = Date.now(); | |
sleep(100).then(()=>console.log(Date.now() - t )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment