Skip to content

Commit

Permalink
fix: maxYieldInterval should not compare with currentTime directly in…
Browse files Browse the repository at this point in the history
… Scheduler-shouldYieldToHost
  • Loading branch information
郭帅彬 authored and acdlite committed Jun 30, 2021
1 parent f6112ff commit 3e8c86c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/scheduler/src/forks/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ function shouldYieldToHost() {
}
// There's no pending input. Only yield if we've reached the max
// yield interval.
return currentTime >= maxYieldInterval;
const timeElapsed = currentTime - (deadline - yieldInterval);
return timeElapsed >= maxYieldInterval;
} else {
// There's still time left in the frame.
return false;
Expand Down

0 comments on commit 3e8c86c

Please sign in to comment.