Skip to content

Interval with MissedTickBehavior::Delay waits less than period #5620

Answered by sergey-ust
sergey-ust asked this question in Q&A
Discussion options

You must be logged in to vote

It seems, that there could be my problem: https://docs.rs/tokio/latest/src/tokio/time/interval.rs.html#478
We have such check for missed tick:
let next = if now > timeout + Duration::from_millis(5)
And in my case the first delay is 105ms = period + 5ms. 105 unfortunately is in allowed range, and I don't get the missed tick condition. The next delay is 98ms, but for Interval it is 98 + 5ms

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Darksonn
Comment options

Answer selected by hawkw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants