Skip to content

Instantly share code, notes, and snippets.

@yuriuliam
Last active August 2, 2023 07:02
Show Gist options
  • Save yuriuliam/f45a4e0a0d85f62026557fc53d3b5995 to your computer and use it in GitHub Desktop.
Save yuriuliam/f45a4e0a0d85f62026557fc53d3b5995 to your computer and use it in GitHub Desktop.
/**
* Wait for given amount of milliseconds.
* @param {number} ms time in milliseconds.
* @returns {Promise<void>}
*/
const wait = async (ms: number): Promise<void> =>
new Promise(resolve => void setTimeout(resolve, ms))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment