mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
time: fix example for MissedTickBehavior::Burst
(#4713)
This commit is contained in:
parent
9f4959580f
commit
323b63fa04
@ -207,6 +207,9 @@ pub enum MissedTickBehavior {
|
|||||||
/// # async fn main() {
|
/// # async fn main() {
|
||||||
/// let mut interval = interval(Duration::from_millis(50));
|
/// let mut interval = interval(Duration::from_millis(50));
|
||||||
///
|
///
|
||||||
|
/// // First tick resolves immediately after creation
|
||||||
|
/// interval.tick().await;
|
||||||
|
///
|
||||||
/// task_that_takes_200_millis().await;
|
/// task_that_takes_200_millis().await;
|
||||||
/// // The `Interval` has missed a tick
|
/// // The `Interval` has missed a tick
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user