* Pauses the execution of an asynchronous function for a specified time.
* @param {number} time - The amount of time to sleep in milliseconds.
* @returns {Promise<void>} - A Promise that resolves after the specified time.
* @throws {Error} - Throws an error if the time is a negative number.
* // throws Error: Invalid time value. Time must be a non-negative number.
export const sleep = (time: number): Promise<void> => {
throw new Error('Invalid time value. Time must be a non-negative number.')
return new Promise<void>(resolve => setTimeout(resolve, time))