The time value in setTimeOut represents the (minimum) delay after which the message will actually be pushed into the queue, meaning that it will not be immediately executed after the time delay has passed, it just says "try and see if this can be executed after x seconds have passed". If there are other messages/functions in the queue then the function will wait till it's turn is reached. Like every queue structure the message queue operates in a FIFO order, executing the oldest/first item first.
In Node.js, each iteration of an Event Loop is called a tick. The difference between process.nextTick() and setTimeout is that the former is specific to the Node.js event loop. The latter uses the JS runtime to schedule it's own queue of events. Callbacks registered with process.nextTick() are evaluated after events in the event queue are processed by the event loop in one iteration i.e it is called on the next tick/iteration from when it is scheduled. We can use process.nextTick to gurantee t