jakubrwisniewski
1/21/2016 - 8:49 AM

Actions wher user is inactive

Actions wher user is inactive

function process() {}

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

requestIdleCallback(work);