import { sleep } from "https://deno.land/x/delayed@2.0.2/src/sleep.ts";
Asynchronous sleep during the specified delay.
Examples
await sleep(500)
//wait 500ms
const ac = new AbortController()
await sleep(1_000_000, ac)
//ac called elsewhere, eg: callback
ac.abort()
//abort sleep before long sleep
Parameters
delay: ms
- The amount of time to wait in milliseconds.
optional
unnamed 1: { signal?: AbortSignal; } = [UNSUPPORTED]