Make duration_since documentation more clear
This commit is contained in:
parent
8ed5cb56b5
commit
98231bfb95
1 changed files with 4 additions and 3 deletions
|
@ -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")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue