1.0.3 • Published 8 years ago
usleep v1.0.3
usleep
sleeptakes a number of seconds and the process will sleep for the given amount of time.msleeptakes a number of milliseconds and the process will sleep for the given amount of time.usleeptakes a number of microseconds and the process will sleep for the given amount of time.
Usage
Example for CommonJS / Node.js
let {msleep} = require('usleep');
msleep(300).then(() => {
console.info('It slept for 300 milliseconds');
});Example for Babel / TypeScript
import {sleep} from 'usleep';
async function foo () {
await sleep(2);
console.info('It slept for 2 seconds');
}Installation
To use the library, install it through npm
npm install --save usleep