重学前端性能优化: requestAnimationFrame & requestIdleCallback All In One
微任务
队列, CPU 调度,时间分片
requestAnimationFrame
cancelAnimationFrame
requestIdleCallback
cancelIdleCallback
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback
demos