If I have a simple setTimeout() function, and set it for 10 seconds…
The the entire server is dead inside those 10 seconds??? Is this true? That’s what I heard.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer is no. What your link Node.js: How would you recreate the 'setTimeout' function without it blocking the event loop? showed was not a
setTimeoutblocking the event loop it was awhileloop that deliberately blocks the event loop. If you want your server to be fast you do not want to block the event loop. An asynchronous callback such assetTimeoutwill work great.Are you trying to block for some reason (like testing or something?)