Skip to content

delay() function

根据给定的 wait 时间延迟值。

Signature:

typescript
declare function delay(wait: number): Promise<void>;

Example

ts
await delay(1000);
console.log("hello"); // after 1000 milliseconds log hello

Open Source Code

Released under the Apache-2.0 License.