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
    type ms = number;
    • The number of milliseconds to wait.

Returns

type T = Promise<void>;