nn-sleep

1.0.0 • Public • Published

nn-sleep

Functions for sleeping.

Usage

import { sleep } from 'nn-sleep';
import { sleepUntil } from 'nn-sleep';

// Wait for 1 second (1000 milliseconds).
await sleep( 1000 );

// Wait until condition is true. Function will be called to test condition at an intervals specified
// by frequency but no longer than the max_duration.
await sleepUntil( function ()
{
	return condition;
}, frequency, max_duration );

Readme

Keywords

none

Package Sidebar

Install

npm i nn-sleep

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

3.65 kB

Total Files

5

Last publish

Collaborators

  • nneba13