Which all phases exactly setImmediate
and setTimeout
goes through.
It's not well-explained what all phases exactly setImmediate and setTimeout goes through, please see the nodeJS guide once there the Phases Overview section says that I/O callback phase is responsible for setImmediate and again in poll and check section says check phase is responsible for setImmediate. so I am a bit confused with it. IO/callback or check or both.
Can somebody please explain the life cycle of the setTimeout
and setImmediate
inside the event loop and how they execute.