Skip to main content
Module

x/timers/mod.ts>interval

All timing functions you need - long and async timeouts, intervals, promise timeouts and more
Latest
function interval
import { interval } from "https://deno.land/x/timers@v0.2.3/mod.ts";

A typed version of setInterval

Examples

Example 1

import { interval } from "https://deno.land/x/timers@v0.2.0/mod.ts";

const interval = setInterval(() => {
  console.log("every 30 days");
}, "30 days");

Type Parameters

optional
T extends any[] = any[]

Parameters

cb: Listener<T>

the callback to call

optional
delay: number | string

the delay in milliseconds

optional
options: IntervalOptions<T> = [UNSUPPORTED]

Returns

number