Skip to content Skip to sidebar Skip to footer

Javascript Internals: At What Interval Does The Event Loop Run?

This is a question about JavaScript internals. Lets say I have 10 async tasks that all take x number of seconds to run. Whilst waiting for a response the script is idle. In the bac

Solution 1:

There is no loop per se in the JavaScript side. There is one in libuv though. Basically libuv will wait until the closest timer hits or an i/o operation happens. Then it will fire a callback in C, which calls the C++ function Node passed and then this triggers JavaScript code to be executed.

Have a look at this presentation, specially the section starting at slide 33.

Post a Comment for "Javascript Internals: At What Interval Does The Event Loop Run?"