Skip to content

Instantly share code, notes, and snippets.

@justinsbarrett
Created September 18, 2021 23:52
Show Gist options
  • Save justinsbarrett/f25e8d21cdb919944d8a794e57b5c377 to your computer and use it in GitHub Desktop.
Save justinsbarrett/f25e8d21cdb919944d8a794e57b5c377 to your computer and use it in GitHub Desktop.
Delay timer
/**
* Delay execution a specified number of seconds.
* @param {number} seconds
*/
function delay(seconds) {
const startTime = Date.now()
while (Date.now() - startTime < seconds * 1000)
continue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment