Skip to content

Higher-precision sleep on Windows #43376

Closed
@clarfonthey

Description

@clarfonthey

Right now, the sleep method uses Sleep on Windows, which only has millisecond precision. Even though the function explicitly allows rounding up to higher ticks, it would be nice to allow higher-precision timers.

After a quick search I was able to find that the SetWaitableTimer function (used in this gist) supports much higher precision timing, so, this is theoretically possible. I'm not particularly good at Windows programming, though, so, I shouldn't be doing this myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-threadArea: `std::thread`C-feature-acceptedCategory: A feature request that has been accepted pending implementation.E-help-wantedCall for participation: Help is requested to fix this issue.O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions