import { timeout } from "https://deno.land/x/timers@v0.2.0/mod.ts";
A typed version of setTimeout
Examples
Example 1
Example 1
import { timeout } from "https://deno.land/x/timers@v0.2.0/mod.ts";
const timeout = timeout(() => {
console.log("in 30 days");
}, "30 days");
Parameters
the delay as string containing the time in a human readable format (e.g. "1 day and 3hours") or a number of in milliseconds
optional
options: TimeoutOptions<T> = [UNSUPPORTED]