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