1.0.2 • Published 5 years ago
siwi-wait v1.0.2
siwi-wait
阻塞执行 在异步函数中等待指定时间
install
use npm
npm install siwi-wait
use yarn
yarn add siwi-wait
Example
const wait = require('siwi-wait')
class Example {
constructor() {
this.init()
}
async init () {
await wait(10000)
console.log(1)
}
}
module.exports = new Example()
等待10秒后输出 1