Skip to content

Instantly share code, notes, and snippets.

@davidroyer
Created February 4, 2021 07:43
Show Gist options
  • Save davidroyer/40dff6ddce3b7ca62d8cc0608a125197 to your computer and use it in GitHub Desktop.
Save davidroyer/40dff6ddce3b7ca62d8cc0608a125197 to your computer and use it in GitHub Desktop.
Delay function using setTimeout with Promises
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment