A collection of private util functions for my personal development.
Install the package into your project directory:
npm i @cilladev/qutils
1. delay
The `delay` function is used to introduce a delay in the execution of a program. It is commonly used in scenarios where you want to pause the execution of a program for a specific amount of time.
-
milliseconds
(integer): The number of milliseconds to delay the program execution.
A promise that resolves after the specified delay.
import { delay } from "@cilladev/qutil"
async function sendRequest() {
await delay(1000) // delay for 1 second
//...
}