- Published on
Sleep function
- Authors
- Name
- Milad E. Fahmy
- @miladezzat12
Sleep function
when you need to delay some code async await
before running.
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
// await sleep(200); // 200 millisecond