1.0.3 • Published 7 years ago

usleep v1.0.3

Weekly downloads
195
License
MIT
Repository
github
Last release
7 years ago

usleep

  • sleep takes a number of seconds and the process will sleep for the given amount of time.
  • msleep takes a number of milliseconds and the process will sleep for the given amount of time.
  • usleep takes 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

API

sleep(int seconds)
msleep(int milliseconds)
usleep(int microseconds)
1.0.3

7 years ago

1.0.4

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago