requestIdleCallback()
developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallbackThe window.requestIdleCallback() method queues a function to be called during a browser's idle periods. This enables developers to perform background and low priority work on the main event loop, without impacting latency-critical events such as animation and input response.