Skip to content

Harden pool timing fidelity for record command - #62

Merged
wkhadgar merged 3 commits into
mainfrom
poll-timing-fidelity
Jun 18, 2026
Merged

Harden pool timing fidelity for record command #62
wkhadgar merged 3 commits into
mainfrom
poll-timing-fidelity

Conversation

@wkhadgar

@wkhadgar wkhadgar commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Recording often caused the requested pediod to be added to reading time, causing less frames than expected to be captured. Make the sleep timer acount for time spent reading the target.

wkhadgar added 3 commits June 18, 2026 16:03
RecordingScraper stamps each call's t with time.perf_counter() instead
of time.time(), so frame-latency and cadence math is monotonic and
high-resolution. The header created_at stays wall-clock.

Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
The polling thread now sleeps the remainder of the period after the
read burst (max(0, period - elapsed)) rather than a full period on top
of the read time, so the poll cadence tracks the requested period.
When the reads already exceed the period, polls run back-to-back.

Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
@wkhadgar wkhadgar self-assigned this Jun 18, 2026
@wkhadgar
wkhadgar merged commit fd128d3 into main Jun 18, 2026
5 checks passed
@wkhadgar
wkhadgar deleted the poll-timing-fidelity branch June 18, 2026 19:19
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