Continuing from libuv/libuv#1035 (comment):
Node.js uses a uv_idle_t handle to implement setImmediate() timers but I think it could - and should - hang them off the big setTimeout() timer.
Right now you have this weird situation where:
a) setTimeout timers run,
b) some other callbacks run (mostly close callbacks), then
c) setImmediate timers run.