Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.shared_globals.d.ts>setTimeout

A modern runtime for JavaScript and TypeScript.
Latest
function setTimeout
import { setTimeout } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.shared_globals.d.ts";

Sets a timer which executes a function once after the delay (in milliseconds) elapses. Returns an id which may be used to cancel the timeout.

setTimeout(() => { console.log('hello'); }, 500);

Parameters

cb: (...args: any[]) => void
optional
delay: number
...args: any[]

Returns

number