requestIdleCallback

A function that schedules low-priority work to run when the browser has spare time at the end of a frame.

In more detail

The callback gets an IdleDeadline to check how much time is left, and a timeout option guarantees it runs eventually if the browser stays busy. It suits analytics, prefetching and background indexing, not visible updates.

Related terms

Taught in

References