Skip to content

Commit

Permalink
improve Matter.Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed May 1, 2024
1 parent 8046341 commit b8a1563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var Common = require('./Common');

(function() {

Runner._maxFrameDelta = 1000 / 5;
Runner._maxFrameDelta = 1000 / 15;
Runner._frameDeltaFallback = 1000 / 60;
Runner._timeBufferMargin = 1.5;
Runner._elapsedNextEstimate = 1;
Expand Down Expand Up @@ -105,7 +105,7 @@ var Common = require('./Common');
var frameDelta = time - runner.timeLastTick;

// fallback for unusable frame delta values (e.g. 0, NaN, on first frame or long pauses)
if (!frameDelta || !runner.timeLastTick || frameDelta > Runner._maxFrameDelta) {
if (!frameDelta || !runner.timeLastTick || frameDelta > Math.max(Runner._maxFrameDelta, runner.maxFrameTime)) {
// reuse last accepted frame delta else fallback
frameDelta = runner.frameDelta || Runner._frameDeltaFallback;
}
Expand Down

0 comments on commit b8a1563

Please sign in to comment.