import { timeout } from "https://deno.land/x/delayed@2.0.2/mod.ts";
Execute the callback at least after the specified delay
Examples
const { status } = await timeout(() => fetch('https://deno.land'), 500)
//wait 500ms and then status === 200
timeout(console.log, 1000, {}, 'delayed', 1000, 's')
//print the message "delayed 1000 s" after 1s
const ac = new AbortController()
timeout(exit, 1000, ac, 1)
ac.abort()
//abort timeout before executing "exit" with arg "1"