@acurrz/node-sleep 中文文档教程
Sleep
睡眠模块使您可以轻松地中断代码。
Installation
npm install @acurrz/node-sleep
Usage
const { sleep } = require('@acurrz/node-sleep');
// Must be in an async function.
async function test(){
console.log('lol1')
await sleep(time) // Must be in milliseconds.
console.log('lol2')
}
test()
Sleep
The sleep module allows you to easily put a break in your code.
Installation
npm install @acurrz/node-sleep
Usage
const { sleep } = require('@acurrz/node-sleep');
// Must be in an async function.
async function test(){
console.log('lol1')
await sleep(time) // Must be in milliseconds.
console.log('lol2')
}
test()