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 @@ -93,11 +93,17 @@ use crate::sys_common::{FromInner, IntoInner};
93
93
/// use std::time::{Instant, Duration};
94
94
///
95
95
/// let now = Instant::now();
96
- /// let max_seconds = u64::MAX / 1_000_000_000;
97
- /// let duration = Duration::new(max_seconds, 0);
96
+ /// let days_per_10_millennia = 365_2425;
97
+ /// let solar_seconds_per_day = 60 * 60 * 24;
98
+ /// let millenium_in_solar_seconds = 31_556_952_000;
99
+ /// assert_eq!(millenium_in_solar_seconds, days_per_10_millennia * solar_seconds_per_day / 10);
100
+ ///
101
+ /// let duration = Duration::new(millenium_in_solar_seconds, 0);
98
102
/// println!("{:?}", now + duration);
99
103
/// ```
100
104
///
105
+ /// For cross-platform code, you can comfortably use durations of up to around one hundred years.
106
+ ///
101
107
/// # Underlying System calls
102
108
///
103
109
/// 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