-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some chrono #933
Remove some chrono #933
Conversation
src/internal/timer.rs
Outdated
duration: Duration, | ||
} | ||
|
||
impl Timer { | ||
/// construct timer, initially set and due `duration_in_ms` in the future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc-strings should be written as proper sentences. They should start with an uppercase letter, and end with a full stop.
/// construct timer, initially set and due `duration_in_ms` in the future | |
/// Construct a `Timer`, which is initially set to expire in due `duration_in_ms` time from the current instant. |
src/internal/timer.rs
Outdated
duration, | ||
} | ||
} | ||
|
||
/// block until next due time resetting afterwards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// block until next due time resetting afterwards | |
/// Block until the due time. The timer will be reset afterwards. |
src/internal/timer.rs
Outdated
} | ||
|
||
/// returns true and resets the timer if due |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// returns true and resets the timer if due | |
/// Returns a boolean indicating whether the timer has expired. the timer will also be reset if it has. |
src/internal/timer.rs
Outdated
true | ||
} else { | ||
false | ||
} | ||
} | ||
|
||
pub fn reset(&mut self) { self.due = Utc::now() + self.duration; } | ||
/// reset timer to be 1 duration after previous due time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// reset timer to be 1 duration after previous due time | |
/// Resets the timer by incrementing the due time using the duration that was passed upon construction of the timer. |
src/internal/timer.rs
Outdated
self.due += self.duration | ||
} | ||
|
||
/// reset timer to be 1 duration from **now** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// reset timer to be 1 duration from **now** | |
/// Resets the timer by restarting from the current instant and setting its due time to the duration that was passed upon construction. This has the same effect as constructing a new `Timer`. |
d20d110
to
0ceffb2
Compare
This PR is only about changes that don't affect public API