Skip to content

fix(timer): resolve timer stutter with monotonic anchor and DOM-write guard#24

Open
natyusha wants to merge 1 commit into
HAERUHAERU:masterfrom
natyusha:timer-fix
Open

fix(timer): resolve timer stutter with monotonic anchor and DOM-write guard#24
natyusha wants to merge 1 commit into
HAERUHAERU:masterfrom
natyusha:timer-fix

Conversation

@natyusha

@natyusha natyusha commented Jun 5, 2026

Copy link
Copy Markdown

The encounter timer occasionally skipped seconds or stuttered due to jitter-induced backtracking (time regression) when synchronizing on every incoming WebSocket packet.

This change resolves the issue by:

  • Establishing a single monotonic system time anchor when combat starts, ensuring the local clock only moves forward.
  • Restricting updates to only occur if the estimated local time drifts significantly from ACT's official duration.
  • Implementing a DOM-write guard to only touch the DOM when the formatted text changes, minimizing layout overhead and processor usage.

Before

ffxiv_dx11_2026-06-05_11-16-20.mp4

After

ffxiv_dx11_2026-06-05_11-15-14.mp4

… guard

The encounter timer occasionally skipped seconds or stuttered due to jitter-induced backtracking (time regression) when synchronizing on every incoming WebSocket packet.

This change resolves the issue by:
- Establishing a single monotonic system time anchor when combat starts, ensuring the local clock only moves forward.
- Restricting updates to only occur if the estimated local time drifts significantly from ACT's official duration.
- Implementing a DOM-write guard to only touch the DOM when the formatted text changes, minimizing layout overhead and processor usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant