Merge branch 'master' into beacon
This commit is contained in:
commit
8bd5de72ea
371 changed files with 33138 additions and 12950 deletions
|
|
@ -3,3 +3,28 @@
|
|||
pub use web_time::Duration;
|
||||
pub use web_time::Instant;
|
||||
pub use web_time::SystemTime;
|
||||
|
||||
/// Creates a [`Duration`] representing the given amount of milliseconds.
|
||||
pub fn milliseconds(milliseconds: u64) -> Duration {
|
||||
Duration::from_millis(milliseconds)
|
||||
}
|
||||
|
||||
/// Creates a [`Duration`] representing the given amount of seconds.
|
||||
pub fn seconds(seconds: u64) -> Duration {
|
||||
Duration::from_secs(seconds)
|
||||
}
|
||||
|
||||
/// Creates a [`Duration`] representing the given amount of minutes.
|
||||
pub fn minutes(minutes: u64) -> Duration {
|
||||
seconds(minutes * 60)
|
||||
}
|
||||
|
||||
/// Creates a [`Duration`] representing the given amount of hours.
|
||||
pub fn hours(hours: u64) -> Duration {
|
||||
minutes(hours * 60)
|
||||
}
|
||||
|
||||
/// Creates a [`Duration`] representing the given amount of days.
|
||||
pub fn days(days: u64) -> Duration {
|
||||
hours(days * 24)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue