This time around, we're requesting the homepage for Google.com and, at the same time, sorting a randomly generated array of 1 million numbers. This is going to take a few seconds, so it's perfect for us to show how well this behaves. We're also going to measure the time it takes for the worker thread to perform the sorting and we're going to send that value (along with the first sorted value) to the main thread, where we'll display the results.A few days ago, version 10.5.0 of Node.js was released and one of the main features it contained was the addition of initial (and experimental) thread support. This is interesting, especially coming from a language that's always prided itself on not needing threads thanks to it's fantastic async I/O. So why would we need threads in Node?


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

javascript,web dev,node.js,threads,backend development