Skip to content

Commit ee8ad8e

Browse files
committed
Update Duration::from_millis doc example to show underlying values.
1 parent aa10fce commit ee8ad8e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libstd/time/duration.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ impl Duration {
102102
/// ```
103103
/// use std::time::Duration;
104104
///
105-
/// let five_seconds = Duration::from_millis(5000);
105+
/// let duration = Duration::from_millis(2569);
106+
///
107+
/// assert_eq!(2, duration.as_secs());
108+
/// assert_eq!(569000000, duration.subsec_nanos());
106109
/// ```
107110
#[stable(feature = "duration", since = "1.3.0")]
108111
#[inline]

0 commit comments

Comments
 (0)