s1eep
v1.0.9
Published
* You can put a delay in a while loop
Downloads
3
Readme
delay method
- You can put a delay in a while loop
Usage
1- Async Sleep
var {asyncsleep, sleep} = require('s1eep');
asyncsleep(n)
: sleep forn
milisecondssleep(n)
: sleep forn
miliseconds
Example
var {asyncsleep, sleep} = require('s1eep');
example-1 {with async method}
async function start(){ while(true){ console.log('hello world) await asyncsleep(1000) } }
example-2 {with regular method}
while(true){ console.log('hello') sleep(1000) }
)