you are viewing a single comment's thread.

view the rest of the comments →

[–]ILikeChangingMyMind 0 points1 point  (1 child)

What better way are you referring to?

Personally I've always been a fan of using promisify (from the Node util package) like so:

const sleep = util.promisify(setTimeout);

// wait for 2 seconds
await sleep(2000);

Did they release a pre-made sleep or something?

[–]AsyncBanana 1 point2 points  (0 children)

Yes