UNPKG

@polgubau/utils

Version:

A collection of utility functions for TypeScript

16 lines (14 loc) 505 B
/** * Pauses the execution for a specified duration. * * @param {number | `${number}ms`} ms - The duration to sleep. It can be a number representing milliseconds or a string in the format `${number}ms`. * @returns {Promise<void>} A promise that resolves after the specified duration. * * @example Sleep for 1000 milliseconds * await sleep(1000); * * @example Sleep for 2 seconds * await sleep("2000ms"); */ declare const sleep: (ms: number | `${number}ms`) => Promise<void>; export { sleep };