mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -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));
|
||
|
}
|