Skip to content

Instantly share code, notes, and snippets.

@drumnickydrum
Last active December 30, 2022 17:38
Show Gist options
  • Save drumnickydrum/4e3df921b3850dde6b2976d7cfbe99c0 to your computer and use it in GitHub Desktop.
Save drumnickydrum/4e3df921b3850dde6b2976d7cfbe99c0 to your computer and use it in GitHub Desktop.
[TS: Sleep Function] A Promise that resolves after ms argument #typescript
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment