Skip to content

Commit 5cce438

Browse files
committed
Review nits
1 parent e28bcce commit 5cce438

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/scheduler/src/forks/Scheduler.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ const isInputPending =
9898
? navigator.scheduling.isInputPending.bind(navigator.scheduling)
9999
: null;
100100

101+
const continuousOptions = {includeContinuous: true};
102+
101103
function advanceTimers(currentTime) {
102104
// Check for tasks that are no longer delayed and add them to the queue.
103105
let timer = peek(timerQueue);
@@ -464,7 +466,7 @@ function shouldYieldToHost() {
464466
} else if (timeElapsed < maxInterval) {
465467
// Yield if there's either a pending discrete or continuous input.
466468
if (isInputPending !== null) {
467-
return isInputPending({includeContinuous: true});
469+
return isInputPending(continuousOptions);
468470
}
469471
} else {
470472
// We've blocked the thread for a long time. Even if there's no pending
@@ -511,9 +513,8 @@ function forceFrameRate(fps) {
511513
const performWorkUntilDeadline = () => {
512514
if (scheduledHostCallback !== null) {
513515
const currentTime = getCurrentTime();
514-
// Yield after `yieldInterval` ms, regardless of where we are in the vsync
515-
// cycle. This means there's always time remaining at the beginning of
516-
// the message event.
516+
// Keep track of the start time so we can measure how long the main thread
517+
// has been blocked.
517518
startTime = currentTime;
518519
const hasTimeRemaining = true;
519520

0 commit comments

Comments
 (0)