Skip to main content
Module

x/composium/test_deps.ts>delay

Powered by functional composition and the URL Pattern API, composium has become the most flexible routing framework in the world.
Go to Latest
function delay
import { delay } from "https://deno.land/x/composium@v0.1.0/test_deps.ts";

Resolve a Promise after a given amount of milliseconds.

Examples

Example 1

import { delay } from "https://deno.land/std@0.224.0/async/delay.ts";

// ...
const delayedPromise = delay(100);
const result = await delayedPromise;
// ...

To allow the process to continue to run as long as the timer exists. Requires --unstable flag.

import { delay } from "https://deno.land/std@0.224.0/async/delay.ts";

// ...
await delay(100, { persistent: false });
// ...

Parameters

ms: number
optional
options: DelayOptions = [UNSUPPORTED]

Returns

Promise<void>