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

This commit is contained in:
郭帅彬
2021-06-30 10:01:04 -04:00
committed by Andrew Clark
parent 4e1fdbbe32
commit e628aede4e
+2 -1
View File
@@ -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;