threadsheep
v1.0.0
Published
sleep time in a thread
Downloads
1
Readme
usage
解决了循环等待cpu满载的问题
let sleep = require('./index');
run();
async function run() {
console.log("before:" + new Date());//before:Fri May 31 2019 16:16:35 GMT+0800 (GMT+08:00)
await sleep(10000);
console.log("after:" + new Date());//after:Fri May 31 2019 16:16:45 GMT+0800 (GMT+08:00)
}