Skip to content

Commit

Permalink
time: add getter for Interval's period (#3705)
Browse files Browse the repository at this point in the history
  • Loading branch information
DBLouis committed Apr 15, 2021
1 parent 9eeec03 commit c8a6bb0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tokio/src/time/interval.rs
Expand Up @@ -176,4 +176,9 @@ impl Interval {
// Return the current instant
Poll::Ready(now)
}

/// Returns the period of the interval.
pub fn period(&self) -> Duration {
self.period
}
}

0 comments on commit c8a6bb0

Please sign in to comment.