0.0.2 • Published 6 years ago

@lvchengbin/sleep v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Sleep

A sleep function for javascript.

Start

$ npm i @lvchengbin/sleep --save

To use it in nodejs:

const sleep = reuqire( '@lvchengbin/sleep' );

Or to import it as an ES6 module:

import sleep = require( '@lvchengbin/sleep' );

Usage

async () => {
    await sleep( 1000 ); // sleep for 1 second
}

sleep( 1000 ).then( () => {
    // execute after 1 second
} );