流浪のwolf

卷帝

导航

等待函数

const wait = (ms) => new Promise((resolve)=> setTimeout(resolve, ms))

const asyncFn = async () => {
  await wait(1000)
  console.log('等待异步函数执行结束')
}

 

posted on 2023-06-30 19:42  流浪のwolf  阅读(4)  评论(0编辑  收藏  举报