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

Timer is ~1ms too slow #57263

Open
jakobnissen opened this issue Feb 4, 2025 · 0 comments · May be fixed by #57264
Open

Timer is ~1ms too slow #57263

jakobnissen opened this issue Feb 4, 2025 · 0 comments · May be fixed by #57264

Comments

@jakobnissen
Copy link
Contributor

On my computer, Timer is about one millisecond too slow:
E.g:

julia> @btime sleep(0.001)
  2.062 ms (4 allocations: 112 bytes)

This also reproduces in more realistic scenarios where I'm timing a loop which can be assumed to be dominated by sleep.

The code for Timer states:

# libuv has a tendency to timeout 1 ms early, so we need +1 on the timeout (in milliseconds), unless it is zero

Maybe this was fixed in libuv?

@jakobnissen jakobnissen linked a pull request Feb 4, 2025 that will close this issue
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 a pull request may close this issue.

1 participant