Actions wher user is inactive
function process() {} function work(deadline) { while(deadline.timeRemaining() > 0) process(); //here we can schedule another requestIdleCallback } requestIdleCallback(work);