Skip to content

nitpick time_sleep_until_basic.phpt #18021

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

divinity76
Copy link
Contributor

@divinity76 divinity76 commented Mar 11, 2025

was randomly failing on my windows-WSL-linux system. (I suspect it was because target time was rounded? Didn't figure out exactly why)

  • remove rounding of target time.
  • remove rounding of tolerance on windows, it looked dodgy.
  • hardcode tolerance rather than dynamically adjusting, makes it easier to reason about.
  • make a dedicated "isWithinTolerance"

Only tested on WSL-Linux as of writing, but the github CI should do the rest.

was randomly failing on my windows-WSL linux system.
remove rounding of target time.
remove rounding of tolerance on windows, it looked dodgy.
hardcode tolerance rather than dynamically adjusting, makes it easier to reason about.

Only tested on WSL-Linux as of writing, but the github CI should do the rest.
@divinity76
Copy link
Contributor Author

divinity76 commented Mar 14, 2025

The FreeBSD and MacOS wakeups are late by 74-106MS, enough to wonder if there actually is something wrong with the time_sleep_until implementation on these platforms 🤔

for comparison, Windows (the OS I expected to do worst) wakeup is late by <50ms, and the Linux wakeups are late by <10ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant