IT lexicon › Programming › Macrotask

Macrotask

Programming På svenska → Updated: 2026-11-15

A lower-priority job in the event loop's main queue that blocks rendering until it completes.

Macrotasks include setTimeout, setInterval, I/O operations, user input events (click, scroll), and HTTP callbacks. After each macrotask, the browser drains the microtask queue, updates styles and layout, paints, and only then picks the next macrotask from the queue. If a macrotask takes longer than ~16 ms (at 60 Hz), the next frame is missed and input feels sluggish.

The distinction between macrotask and microtask is a frequent source of confusion: microtasks always run before rendering; macrotasks run one-at-a-time with rendering in between. Long macrotasks are one of the top causes of jank on the web.

← Back to the lexicon