1111import {
1212 enableSchedulerDebugging ,
1313 enableProfiling ,
14+ enableIsInputPending ,
15+ enableIsInputPendingContinuous ,
16+ frameYieldMs ,
17+ continuousYieldMs ,
1418} from '../SchedulerFeatureFlags' ;
1519
1620import { push , pop , peek } from '../SchedulerMinHeap' ;
@@ -36,8 +40,6 @@ import {
3640 startLoggingProfilingEvents ,
3741} from '../SchedulerProfiling' ;
3842
39- import { enableIsInputPending } from '../SchedulerFeatureFlags' ;
40-
4143let getCurrentTime ;
4244const hasPerformanceNow =
4345 typeof performance === 'object' && typeof performance . now === 'function' ;
@@ -98,7 +100,7 @@ const isInputPending =
98100 ? navigator . scheduling . isInputPending . bind ( navigator . scheduling )
99101 : null ;
100102
101- const continuousOptions = { includeContinuous : true } ;
103+ const continuousOptions = { includeContinuous : enableIsInputPendingContinuous } ;
102104
103105function advanceTimers ( currentTime ) {
104106 // Check for tasks that are no longer delayed and add them to the queue.
@@ -427,9 +429,8 @@ let taskTimeoutID = -1;
427429// thread, like user events. By default, it yields multiple times per frame.
428430// It does not attempt to align with frame boundaries, since most tasks don't
429431// need to be frame aligned; for those that do, use requestAnimationFrame.
430- // TODO: Make these configurable
431- let frameInterval = 5 ;
432- const continuousInputInterval = 50 ;
432+ let frameInterval = frameYieldMs ;
433+ const continuousInputInterval = continuousYieldMs ;
433434const maxInterval = 300 ;
434435let startTime = - 1 ;
435436
@@ -506,7 +507,7 @@ function forceFrameRate(fps) {
506507 frameInterval = Math . floor ( 1000 / fps ) ;
507508 } else {
508509 // reset the framerate
509- frameInterval = 5 ;
510+ frameInterval = frameYieldMs ;
510511 }
511512}
512513
0 commit comments