Skip to content

Commit

Permalink
🐛 user-visible should run for 80% of 1 frame when 60fps (13ms)
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jan 16, 2024
1 parent 75fa620 commit 4abfdb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/isTimeToYield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function calculateDeadline(priority: SchedulingPriority): number {
case 'user-visible': {
// spent 80% percent of the frame's budget running 'user-visible' tasks:
// - Math.round((1000/60) * 0.8) = Math.round(13,333) = 13
return schedulingState.thisFrameWorkStartTime + 4
return schedulingState.thisFrameWorkStartTime + 13
}
case 'background': {
const idleDeadline =
Expand Down

0 comments on commit 4abfdb3

Please sign in to comment.