Skip to content

Instantly share code, notes, and snippets.

@wahengchang
Created December 10, 2016 04:31
Show Gist options
  • Select an option

  • Save wahengchang/0024cbbab2966f8917e9a9b9c55eb1da to your computer and use it in GitHub Desktop.

Select an option

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