Skip to content

Timer is ~1ms too slow #57263

@jakobnissen

Description

@jakobnissen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions