Skip to content

wait

Type : function

since: v2.4.0

The wait function returns a promise that resolves after a specified amount of time. It is useful for adding a delay to your code.

Usage

import { wait } from '@mustib/utils';
await wait(1000); // wait for 1 second

Definition

function wait(ms: number): Promise<void> {}
  • parameters:

    1. ms: number
      • The number of milliseconds to wait.
  • returns: Promise<void>