Timeouts are not checked on every event loop, hence the 4ms delay. And no, setTimeout is asynchronous and processed during the event loop.
Basic event loop is; timeouts, js execution, repaint, reflow, etc
Basic event loop is; timeouts, js execution, repaint, reflow, etc
Also useful if you need to wait until after all event handlers are executed in the current context