Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize semu_timer_clocksource() precision on macOS #61

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

visitorckw
Copy link
Contributor

Improve the precision of semu_timer_clocksource() by deferring the division by 1e9 until the final step. Since t.numer and t.denom are typically much smaller compared to the clock frequency and 1e9, performing the division earlier in the calculation could result in a significant loss of precision. This change ensures that precision is preserved by delaying the division until the end of the computation.

Improve the precision of semu_timer_clocksource() by deferring the
division by 1e9 until the final step. Since t.numer and t.denom are
typically much smaller compared to the clock frequency and 1e9,
performing the division earlier in the calculation could result in a
significant loss of precision. This change ensures that precision is
preserved by delaying the division until the end of the computation.
@jserv jserv merged commit 92218e3 into sysprog21:master Sep 12, 2024
2 checks passed
@jserv
Copy link
Collaborator

jserv commented Sep 12, 2024

Thank @visitorckw for contributing!

@visitorckw visitorckw deleted the optimize-semu-timer-precision branch September 13, 2024 02:27
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.

4 participants