mirror of
https://github.com/denoland/deno.git
synced 2024-12-18 13:22:55 -05:00
5 lines
184 B
JavaScript
5 lines
184 B
JavaScript
|
export async function randomTimeout(min, max) {
|
||
|
const timeout = Math.floor(Math.random() * (max - min + 1) + min);
|
||
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
||
|
}
|