MCPcopy Create free account
hub / github.com/reactjs/react-rails / advanceTimers

Function advanceTimers

lib/assets/react-source/development/react.js:3317–3342  ·  view source on GitHub ↗
(currentTime)

Source from the content-addressed store, hash-verified

3315 var isHostTimeoutScheduled = false;
3316
3317 function advanceTimers(currentTime) {
3318 // Check for tasks that are no longer delayed and add them to the queue.
3319 var timer = peek(timerQueue);
3320
3321 while (timer !== null) {
3322 if (timer.callback === null) {
3323 // Timer was cancelled.
3324 pop(timerQueue);
3325 } else if (timer.startTime <= currentTime) {
3326 // Timer fired. Transfer to the task queue.
3327 pop(timerQueue);
3328 timer.sortIndex = timer.expirationTime;
3329 push(taskQueue, timer);
3330
3331 {
3332 markTaskStart(timer, currentTime);
3333 timer.isQueued = true;
3334 }
3335 } else {
3336 // Remaining timers are pending.
3337 return;
3338 }
3339
3340 timer = peek(timerQueue);
3341 }
3342 }
3343
3344 function handleTimeout(currentTime) {
3345 isHostTimeoutScheduled = false;

Callers 3

handleTimeoutFunction · 0.85
workLoopFunction · 0.85
unstable_shouldYieldFunction · 0.85

Calls 4

popFunction · 0.85
markTaskStartFunction · 0.85
peekFunction · 0.70
pushFunction · 0.70

Tested by

no test coverage detected