timers phase

The first phase of each event loop turn, which runs the callbacks of setTimeout and setInterval timers that have expired.

In more detail

libuv keeps timers in a min-heap ordered by expiry time, so it only needs to look at the earliest one to know whether any are due. A timer's callback therefore never runs before its delay, but it can run later when earlier phases are busy.

Related terms

Taught in

References