Delay a promise a random amount of time set in the interval
$ npm i delay-random
const delayRandom = require('delay-random');
(async () => {
const milliseconds = await delayRandom(1000, 1500);
// Random integer value between numbers 1000 and 1500
console.log(milliseconds)
})();
Create a promise which resolves after the random set in the interval milliseconds
.
Type: number
Starting range specified in milliseconds.
Type: number
Ending range specified in milliseconds.
MIT © Nikolay Lapshin