11
11
import {
12
12
enableSchedulerDebugging ,
13
13
enableProfiling ,
14
+ enableIsInputPending ,
15
+ enableIsInputPendingContinuous ,
16
+ frameYieldMs ,
17
+ continuousYieldMs ,
14
18
} from '../SchedulerFeatureFlags' ;
15
19
16
20
import { push , pop , peek } from '../SchedulerMinHeap' ;
@@ -36,8 +40,6 @@ import {
36
40
startLoggingProfilingEvents ,
37
41
} from '../SchedulerProfiling' ;
38
42
39
- import { enableIsInputPending } from '../SchedulerFeatureFlags' ;
40
-
41
43
let getCurrentTime ;
42
44
const hasPerformanceNow =
43
45
typeof performance === 'object' && typeof performance . now === 'function' ;
@@ -98,7 +100,7 @@ const isInputPending =
98
100
? navigator . scheduling . isInputPending . bind ( navigator . scheduling )
99
101
: null ;
100
102
101
- const continuousOptions = { includeContinuous : true } ;
103
+ const continuousOptions = { includeContinuous : enableIsInputPendingContinuous } ;
102
104
103
105
function advanceTimers ( currentTime ) {
104
106
// Check for tasks that are no longer delayed and add them to the queue.
@@ -427,9 +429,8 @@ let taskTimeoutID = -1;
427
429
// thread, like user events. By default, it yields multiple times per frame.
428
430
// It does not attempt to align with frame boundaries, since most tasks don't
429
431
// 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 ;
433
434
const maxInterval = 300 ;
434
435
let startTime = - 1 ;
435
436
@@ -506,7 +507,7 @@ function forceFrameRate(fps) {
506
507
frameInterval = Math . floor ( 1000 / fps ) ;
507
508
} else {
508
509
// reset the framerate
509
- frameInterval = 5 ;
510
+ frameInterval = frameYieldMs ;
510
511
}
511
512
}
512
513
0 commit comments