📜  节点 js 异步延迟 - Javascript 代码示例

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

代码示例2
const { promisify } = require('util');

const delay = promisify(setTimeout);

// Usage:
(async () => {
  console.log('1');
  await delay(1000);
  console.log('2');
})();