1.

What are some commonly used timing features of Node.js?

Answer»
  • setTimeout/clearTimeout – This is used to implement DELAYS in code execution.
  • setInterval/clearInterval – This is used to run a code block multiple times.
  • SETIMMEDIATE/clearImmediate – Any FUNCTION passed as the setImmediate() argument is a callback that's executed in the NEXT iteration of the event loop.
  • process.nextTick – Both setImmediate and process.nextTick appear to be doing the same thing; HOWEVER, you may prefer one over the other depending on your callback’s urgency. 


Discussion

No Comment Found