Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/pita_api/deps.ts>sleep

API for Pita projects, simpliest way to develop secure and powerful webapps for redpitaya.
Latest
function sleep
Re-export
import { sleep } from "https://deno.land/x/pita_api@0.9.1/deps.ts";

Asynchronous sleep during the specified delay.

Examples

await sleep(500)
//wait 500ms
const ac = new AbortController()
await sleep(1_000_000, ac)
//ac called elsewhere, eg: callback
ac.abort()
//abort sleep before long sleep

Parameters

delay: ms
  • The amount of time to wait in milliseconds.
optional
unnamed 1: { signal?: AbortSignal; } = [UNSUPPORTED]

Returns

Promise<void>