Skip to content

timer.device: GetSysTime and ReadEClock resolve microseconds - #202

Merged
sidick merged 1 commit into
sidick:mainfrom
codewiz:eclock-host-micro
Oct 23, 2026
Merged

sidick merged 1 commit into
sidick:mainfrom
codewiz:eclock-host-micro

Conversation

@codewiz

@codewiz codewiz commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Without --clock-mhz, ReadEClock and GetSysTime (and intuition's CurrentTime) take the host time from host_time_secs_micro(), which went through now_as_datestamp() and its 1/50 s ticks. Every tv_micro was a multiple of 20000, and every interval a program timed with ReadEClock a multiple of 20 ms.

That makes --jit timings useless for short runs. BenchWork under --jit --cpu 68040 printed 60.000, 279.999, 300.000 ms and so on. With this change it prints 68.426, 232.098, 313.870 ms.

host_time_secs_micro() now reads SystemTime itself and keeps subsec_micros(). DateStamp is unchanged. The new test host_time_has_microsecond_resolution fails on main.

pending_host_break_folds_into_check_signal and pending_host_break_folds_into_wait fail on main as well as on this branch (cargo test -p volamos-core). This PR doesn't touch them.

🤖 Generated with Claude Code

Both read the host clock through DateStamp's 1/50s ticks, so without
--clock-mhz every interval a program timed with ReadEClock was a
multiple of 20 ms.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@sidick
sidick merged commit fd8b114 into sidick:main Oct 23, 2026
9 checks passed
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.

2 participants