The 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. Functions are generally called in first-in-first-out order unless the function's timeout is reached before the browser calls it.
var handle = window.requestIdleCallback(callback[, options])
didTimeout: A boolean that returns false if the callback was invoked by the user agent during idle, and true otherwise (e.g. if a timeout option was given and expired before there was sufficient idle time).
Contains optional configuration parameters. It has the following property:
timeout: A deadline by which the browser must call the given callback function. This value is given in milliseconds.