Async version of High precision sleep calls in rust

Hi Everyone,

I am currently looking for an asynchronous sleep call in rust with a precision microsecond or nanosecond in rust. Currently, I am using the sleep_until() provided by Tokio crate. However, this function call only allows precision in the order of milliseconds. Any inputs for introducing asynchronous delays of the order of microseconds will be highly appreciated.

Thank you

Try the tokio-timerfd crate.

Note that there's a reason the cross platform sleep only goes to milliseconds: microsecond timeouts basically don't exist in Windows: the scheduler rounds to ~16ms by default for efficiency (I don't know what Linux does).

There's the multimedia timer API, but I believe that's implemented by running a user thread that busy-waits?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.