@6du/sleep 中文文档教程
await-sleep
使用 async/await 简单睡眠
Installation
npm install --save await-sleep
Usage
import * as sleep from 'await-sleep';
async function myAsyncFunction() {
console.time('Sleeping');
await sleep(1500);
console.timeEnd('Sleeping'); // Sleeping: 1507.180ms
}
await-sleep
Simple sleep with async/await
Installation
npm install --save await-sleep
Usage
import * as sleep from 'await-sleep';
async function myAsyncFunction() {
console.time('Sleeping');
await sleep(1500);
console.timeEnd('Sleeping'); // Sleeping: 1507.180ms
}