p-sleep
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

p-sleep

Promisified sleep function.

Installation

npm install --save p-sleep

Usage

const sleep = require('p-sleep')
 
sleep(200).then(() => console.log('World!'))
sleep(100).then(() => console.log('Hello,'))

API

sleep(ms: number) => Promise<void>

Returns a Promise that resolves after ms milliseconds.

Readme

Keywords

none

Package Sidebar

Install

npm i p-sleep

Weekly Downloads

6,939

Version

1.1.0

License

MIT

Last publish

Collaborators

  • linusu