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

x/ayonli_jsext/esm/async.js>sleep

A JavaScript extension package for building strong and modern applications.
Latest
function sleep
import { sleep } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/async.js";

Blocks the context for a given duration.

Examples

Example 1

import { sleep } from "@ayonli/jsext/async";

console.log("Hello");

await sleep(1000);
console.log("World"); // "World" will be printed after 1 second