File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 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};
9696/// use std::time::{Instant, Duration};
9797///
9898/// 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);
101105/// println!("{:?}", now + duration);
102106/// ```
103107///
108+ /// For cross-platform code, you can comfortably use durations of up to around one hundred years.
109+ ///
104110/// # Underlying System calls
105111///
106112/// 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