macrotask

An ordinary task scheduled on the event loop, such as a timer or I/O callback, as opposed to a microtask.

In more detail

Only one macrotask runs at a time, and all pending microtasks run after it before the next one starts. Specifications usually just call them tasks. In a browser the page can also redraw between tasks, so splitting long work into several tasks, for example with setTimeout(fn, 0), keeps it responsive.

Related terms

Taught in

References