@queso/sleep
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@queso/sleep

npm license Travis Build Status codecov Try @queso/sleep on RunKit

Part of a library of zero-dependency npm modules that do just one thing.

npm

min + gzip | 93 bytes

source

Sleeps for a specified duration.

Usage

import sleep from '@queso/sleep'

async function brb() {
console.log('Be back in 42 seconds...')
await sleep(42000)
console.log("OK, I'm back!")
}

Parameters

Name Type Description
duration number Time in milliseconds to sleep.

Returns

A Promise that resolves when the specified duration has ellapsed.

Return type

Promise<void>

Package Sidebar

Install

npm i @queso/sleep

Weekly Downloads

9

Version

0.3.0

License

MIT

Unpacked Size

8.7 kB

Total Files

8

Last publish

Collaborators

  • jedmao