punctual_sleep

Crates.iopunctual_sleep
lib.rspunctual_sleep
version0.1.0
created_at2021-04-30 22:41:07.953759+00
updated_at2023-11-15 00:56:31.484036+00
descriptionCrate for more precise sleeping
homepage
repository
max_upload_size
id391727
size25,207
(AngelicosPhosphoros)

documentation

README

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.

Commit count: 0

cargo fmt