File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,17 @@ use crate::sys_common::{FromInner, IntoInner};
96
96
/// use std::time::{Instant, Duration};
97
97
///
98
98
/// let now = Instant::now();
99
- /// let max_seconds = u64::MAX / 1_000_000_000;
100
- /// let duration = Duration::new(max_seconds, 0);
99
+ /// let days_per_10_millennia = 365_2425;
100
+ /// let solar_seconds_per_day = 60 * 60 * 24;
101
+ /// let millenium_in_solar_seconds = 31_556_952_000;
102
+ /// assert_eq!(millenium_in_solar_seconds, days_per_10_millennia * solar_seconds_per_day / 10);
103
+ ///
104
+ /// let duration = Duration::new(millenium_in_solar_seconds, 0);
101
105
/// println!("{:?}", now + duration);
102
106
/// ```
103
107
///
108
+ /// For cross-platform code, you can comfortably use durations of up to around one hundred years.
109
+ ///
104
110
/// # Underlying System calls
105
111
///
106
112
/// The following system calls are [currently] being used by `now()` to find out
You can’t perform that action at this time.
0 commit comments