nn-sleep
v1.0.0
Published
Functions for sleeping.
Downloads
2
Readme
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 );