@samitouri / QOS-React-2 / commits / 3e8c86c1c8

fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost

郭帅彬 committed Jun 30, 2021 at 09:52 UTC 3e8c86c1c84559f2552a493970c50143c8757043
1 file changed +2 -1
packages/scheduler/src/forks/Scheduler.js
+2 -1
@@ -450,7 +450,8 @@ function shouldYieldToHost() {
450 }
451 // There's no pending input. Only yield if we've reached the max
452 // yield interval.
453 - return currentTime >= maxYieldInterval;
453 + const timeElapsed = currentTime - (deadline - yieldInterval);
454 + return timeElapsed >= maxYieldInterval;
455 } else {
456 // There's still time left in the frame.
457 return false;