Created
December 10, 2016 04:31
-
-
Save wahengchang/0024cbbab2966f8917e9a9b9c55eb1da to your computer and use it in GitHub Desktop.
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
var sleep = function(para) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
resolve(para * para) | |
}, 1000) | |
}) | |
} | |
async function asyncSleep (para){ | |
return await sleep(para) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment