-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High-precision timers #970
Comments
Good question. Do you have any thoughts on how to proceed? |
I played with one approach in this PR: https://github.com/polachok/tokio/pull/1/files. |
@carllerche any comments? |
@polachok Is there anyway you could submit your PR on this repo? It'll give others a better chance to review and contribute. |
@tobz it's more a proof-of-concept than a proper PR, but if you think it's approriate, I will |
I've been playing around with generic timer implementation here, if you're interested But it targets std's futures, so there is only |
It would probably be fine to provide a highres-timer option in Tokio... or update tokio_timer::Delay to have an option to pick high res. |
That said, I'm going to close due to inactivity. Any proposal that would be considered for inclusion in Tokio would need to:
I looked quickly at windows and I do not see an obvious option there. However, if someone wants to take a stab at this, I would suggest opening a new issue w/ the proposal and cross reference this issue. |
Version
0.1.16
Platform
Linux e8ab1d1f59b1 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Subcrates
tokio-timer
Description
tokio-timer supports delays with 1ms resolution, while my use case requires higher resolution timers.
On Linux, timerfd provides access to sub-millisecond timers as file descriptors. I implemented a simple periodic timer in tokio-timerfd, which works fine, but I would also like to have APIs like
DelayQueue
. I'm asking for advice on how to best proceed with this. I'd like to avoid duplicating tokio-timer code in my crate, but it seems like there's no way to plug in my own timer implementation.The text was updated successfully, but these errors were encountered: