Skip to content

Instantly share code, notes, and snippets.

@wahengchang
Created December 10, 2016 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wahengchang/0024cbbab2966f8917e9a9b9c55eb1da to your computer and use it in GitHub Desktop.
Save wahengchang/0024cbbab2966f8917e9a9b9c55eb1da to your computer and use it in GitHub Desktop.
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