mirror of
https://github.com/denoland/deno.git
synced 2024-12-26 17:19:06 -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));
|
||
|
}
|