time: add getter for Interval's period (#3705)

This commit is contained in:
madjack 2021-04-15 15:21:52 +03:00 committed by GitHub
parent 9eeec039f2
commit c8a6bb0b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
}