Using requestIdleCallback  |  Blog  |  Chrome for Developers

requestIdleCallback is new performance API for scheduling work when the browser is idle.