File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -318,19 +318,11 @@ impl Duration {
318318 /// assert_eq!(duration.as_secs(), 5);
319319 /// ```
320320 ///
321- /// To determine the total number of seconds represented by the `Duration`,
322- /// use `as_secs` in combination with [`subsec_nanos`]:
323- ///
324- /// ```
325- /// use std::time::Duration;
326- ///
327- /// let duration = Duration::new(5, 730023852);
328- ///
329- /// assert_eq!(5.730023852,
330- /// duration.as_secs() as f64
331- /// + duration.subsec_nanos() as f64 * 1e-9);
332- /// ```
321+ /// To determine the total number of seconds represented by the `Duration`
322+ /// including the fractional part, use [`as_secs_f64`] or [`as_secs_f32`]
333323 ///
324+ /// [`as_secs_f32`]: Duration::as_secs_f64
325+ /// [`as_secs_f64`]: Duration::as_secs_f32
334326 /// [`subsec_nanos`]: Duration::subsec_nanos
335327 #[ stable( feature = "duration" , since = "1.3.0" ) ]
336328 #[ rustc_const_stable( feature = "duration_consts" , since = "1.32.0" ) ]
You can’t perform that action at this time.
0 commit comments