Skip to content

Commit 3e8c86c

Browse files
郭帅彬acdlite
郭帅彬
authored andcommitted
fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost
1 parent f6112ff commit 3e8c86c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/scheduler/src/forks/Scheduler.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ function shouldYieldToHost() {
450450
}
451451
// There's no pending input. Only yield if we've reached the max
452452
// yield interval.
453-
return currentTime >= maxYieldInterval;
453+
const timeElapsed = currentTime - (deadline - yieldInterval);
454+
return timeElapsed >= maxYieldInterval;
454455
} else {
455456
// There's still time left in the frame.
456457
return false;

0 commit comments

Comments
 (0)