mirror of
https://github.com/denoland/deno.git
synced 2024-12-30 02:59:11 -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));
|
||
|
}
|