async function delay(time = 1000) {
  return new Promise(resolve => setTimeout(resolve, time));
}
Delay execution by a specified time.
@param {number} time - Delay duration in milliseconds. Default is 1000ms.
@returns {Promise<void>} Resolves after the specified delay.