Skip to content
pedestrian signage displaying wait


Monday, 19 April 2021

At 69 words, this article should take about 18 seconds to read.

This article is more than a year old and the information in it may be out of date.

Why the rush…?!

Whether you're faking an API response, introducing deliberate cognitive drain, or simply want to slow things down this utility function has got you, baby! 😎

const delay = ms => new Promise(rv => setTimeout(rv, ms))

Cool! How do I use it?

delay(500).then(() => console.log(`hello world`))

Nice! Does it work with async/await?

Heck, yes, it does!

const functionName = async () => {


  await delay(500)


Cover image courtesy of Alex.



In almost all cases, the comments section is a vile cesspool of Reply Guys, racists, and bots.

I don't want to have to deal with that kind of hell so I don't have a comments section.

If you want to continue the conversation, you can always hit me up on Mastodon (which is not a vile cesspool of Reply Guys, racists, and bots).

Thomas Rigby

Thomas Rigby

When I'm not building things for the internet, I take photos of stuff.

Pronouns: he/him/his

Real. Simple. Syndication.

Get my latest content in your favorite RSS reader. I use InoReader but you don't have to.

What even is an RSS feed?!


Last played

Burn the Bitch

Ulver || Svidd Neger

Loading Invisible Visible RSS Navigation Close Arrow Info Online Online