Returns function which produces a random number of seconds, with a unit of milliseconds.
Maximum value is exclusive.
Use secondsMs to return a random value directly, or secondsMsSource to return a function.
Remarks
It's a very minor function, but can make
code a little more literate:
// Random timeout of up to 5 seconds setTimeout(() => { ...}, secondsMsSource(5));
Example: Random milliseconds between 0..4999
secondsMs(5000);
Example: Options can be provided
// Random milliseconds between 1000-4999 secondsMs({ max:5, min:1 });
Returns function which produces a random number of seconds, with a unit of milliseconds. Maximum value is exclusive. Use secondsMs to return a random value directly, or secondsMsSource to return a function.
Remarks
It's a very minor function, but can make code a little more literate:
Example: Random milliseconds between 0..4999
Example: Options can be provided