📜  在nodejs中睡觉? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:16.033000             🧑  作者: Mango

代码示例1
await sleep(1000)
function sleep(ms) {
  return new Promise((resolve) => {
    setTimeout(resolve, ms);
  });
}