Saturday, 1 April 2017

What is the sleep time between ticks in nodejs

I am asking about the nodejs internals: I would like to know if there there are any sleep time between ticks in nodejs' event loop.

In other words, I assume nodejs internal looks like the code below, I would like to what is the value of sometime, if any.

while(true) {
  for(event in queue) handleEvent(event);
  sleep(sometime);
}

I made such assumption because I believe there must exist some kind of sleeping such that the while loop will not exhaust the CPU.



via KevinResoL

No comments:

Post a Comment