Last active
June 30, 2022 06:34
-
-
Save guoshuai93/0fc4d055fca2aa3dafe74de32a1c585c to your computer and use it in GitHub Desktop.
[js_util]
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 sleep(ms: number = 3000): Promise<string> { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, ms, 'done') | |
}) | |
} | |
sleep(1500).then(val => console.log(val)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment