function delay
delay(ms: number,options?: DelayOptions): Promise<void>Resolve a Promise after a given amount of milliseconds.
Examples
Example 1
Example 1
import { delay } from "@std/async/delay"; // ... const delayedPromise = delay(100); const result = await delayedPromise; // ...
To allow the process to continue to run as long as the timer exists.
import { delay } from "@std/async/delay"; // ... await delay(100, { persistent: false }); // ...
Parameters
ms: numberoptional
options: DelayOptionsReturn Type
Promise<void>