-
-
Notifications
You must be signed in to change notification settings - Fork 3k
time: Clarify MissedTickBehavior documentation
#7941
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,9 @@ fn internal_interval_at( | |
| /// `MissedTickBehavior` can be used to specify a different behavior for | ||
| /// [`Interval`] to exhibit. Each variant represents a different strategy. | ||
| /// | ||
| /// With all tick behaviors, the next tick after a missed tick will always | ||
| /// complete immediately. | ||
| /// | ||
| /// Note that because the executor cannot guarantee exact precision with timers, | ||
| /// these strategies will only apply when the delay is greater than 5 | ||
| /// milliseconds. | ||
|
|
@@ -294,12 +297,11 @@ pub enum MissedTickBehavior { | |
| /// When this strategy is used, [`Interval`] schedules the next tick to fire | ||
| /// at the next-closest tick that is a multiple of `period` away from | ||
| /// `start` (the point where [`Interval`] first ticked). Like [`Burst`], all | ||
| /// ticks remain multiples of `period` away from `start`, but unlike | ||
| /// [`Burst`], the ticks may not be *one* multiple of `period` away from the | ||
| /// last tick. Like [`Delay`], the ticks are no longer the same as they | ||
| /// would have been if ticks had not been missed, but unlike [`Delay`], and | ||
| /// like [`Burst`], the ticks may be shortened to be less than one `period` | ||
| /// away from each other. | ||
| /// ticks remain multiples of `period` away from `start`. Like [`Delay`], | ||
| /// the number of fired ticks are no longer the same as they would have been | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I think rephrasing this as "number of fired ticks" is an improvement compared to just "ticks are no longer the same", especially since a lot of this section talks about duration and not count. That said, this was mostly a driveby idea I had for rephrasing things, I'm happy to discard if you disagree with this change. |
||
| /// if ticks had not been missed, but unlike [`Delay`], and like [`Burst`], | ||
| /// the ticks may be shortened to be less than one `period` away from each | ||
| /// other. | ||
| /// | ||
| /// This looks something like this: | ||
| /// ```text | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized that this is most likely a typo and meant to say
Delaywhen I wrote the commit message. If someone can confirm this I can change that rather than removing this section entirely.