2 unstable releases

0.1.0 Nov 15, 2023
0.0.1 Apr 30, 2021

#127 in Windows APIs


227 lines

Punctual Sleep

This crate exists to provide more precise sleeping routine compared to std::thread::sleep.

Main motivation to implement this crate was usage in games for Windows operating systems. On Windows, std::thread::sleep was as precise as 15 ms or worse so this crate was intended to fix that. It manages to be in range of 2 ms of requested time almost always.

However, standard library was fixed after that to use exact same method as this crate so there is no need to do that anymore.

This code remains as easy to look example of such sleeping routine. Another use-case is if you don't want to recreate WinAPI timer every time you need.

Licensing and contribution

Crate licensed MIT or Apache-2.0 license on your option.
Any contributor (author of added code) to library agrees to distribute of his code by both licenses by making contribution.


~521K SLoC