Skip to content

Instantly share code, notes, and snippets.

@samthomson
Created January 27, 2021 15:53
Show Gist options
  • Save samthomson/02c9ba278b3de3161ae49aee240a7c70 to your computer and use it in GitHub Desktop.
Save samthomson/02c9ba278b3de3161ae49aee240a7c70 to your computer and use it in GitHub Desktop.
returns a promise that delays a certain number of milliseconds based on provided parameter
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment