🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

usleep

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usleep

Add sleep functions: sleep(), msleep(), usleep()

1.0.3
latest
Source
npm
Version published
Weekly downloads
286
-51.19%
Maintainers
1
Weekly downloads
 
Created
Source

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)

Keywords

sleep

FAQs

Package last updated on 15 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts