1//! Keep track of time, both in native and web platforms!
23pub use web_time::Duration;
4pub use web_time::Instant;
5pub use web_time::SystemTime;
67/// Creates a [`Duration`] representing the given amount of milliseconds.
8pub fn milliseconds(milliseconds: u64) -> Duration {
9 Duration::from_millis(milliseconds)
10}
1112/// Creates a [`Duration`] representing the given amount of seconds.
13pub fn seconds(seconds: u64) -> Duration {
14 Duration::from_secs(seconds)
15}
1617/// Creates a [`Duration`] representing the given amount of minutes.
18pub fn minutes(minutes: u64) -> Duration {
19 seconds(minutes * 60)
20}
2122/// Creates a [`Duration`] representing the given amount of hours.
23pub fn hours(hours: u64) -> Duration {
24 minutes(hours * 60)
25}
2627/// Creates a [`Duration`] representing the given amount of days.
28pub fn days(days: u64) -> Duration {
29 hours(days * 24)
30}