Milad
BlogTagsProjectsOSPBooksCoursesLifeAbout
Blog
Tags
Projects
OSP
Books
Courses
Life
About
Saturday, June 12, 2021•☕️ 1 min read

Sleep function

JavaScript
avatar
Milad E. Fahmy
@miladezzat12
Discuss on TwitterView on GitHub

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
Discuss on TwitterView on GitHub
← Previous
Create uuid (unique id)
Next →
Array Type Inference
Back to Blog

Milad Ezzat

Milad is a software engineer, with 9+ years of experience at nodejs

Quick Links

  • Blog
  • About
  • Projects
  • Life

Connect

mailgithublinkedintwitteryoutubefacebook
© 2025 Milad Ezzat. All rights reserved.
Made with ❤️ using Next.js