In python, it is easy to create a time delay with time.sleep()
. Is there any equivalent for node.js? I cannot find it. I suspect it may be due to asynchronous nature of node.js. Hoping someone on StackOverflow can provide an easy solution like time.sleep()
in node.js or javascript.
Asked
Active
Viewed 493 times
0

guagay_wk
- 26,337
- 54
- 186
- 295
-
setTimeout loop .. – Daniel Mar 25 '16 at 13:11
-
1It's not exactly an apples to apples comparison, sleeping in python vs js so it's difficult to answer. Perhaps you could share your actual problem? – aw04 Mar 25 '16 at 13:14
-
Probably approaching problem all wrong and should be using promises – charlietfl Mar 25 '16 at 13:40