Skip to content

Commit

Permalink
Make duration_since documentation more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Brausch committed Sep 8, 2020
1 parent 8ed5cb5 commit 98231bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/std/src/time.rs
Expand Up @@ -457,12 +457,13 @@ impl SystemTime {
///
/// # Examples
///
/// ```
/// ```no_run
/// use std::time::SystemTime;
///
/// let sys_time = SystemTime::now();
/// let difference = sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// let new_sys_time = SystemTime::now();
/// let difference = new_sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// println!("{:?}", difference);
/// ```
#[stable(feature = "time2", since = "1.8.0")]
Expand Down

0 comments on commit 98231bf

Please sign in to comment.