Skip to content

Commit

Permalink
pb: add reset_start_time option (#96)
Browse files Browse the repository at this point in the history
* Added reset_start_time

* Added docs

* Update pb.rs
  • Loading branch information
diondokter committed Nov 16, 2020
1 parent ecac143 commit cde265b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ impl<T: Write> ProgressBar<T> {
self.add(1)
}

/// Resets the start time to now
pub fn reset_start_time(&mut self) {
self.start_time = SteadyTime::now();
}

fn draw(&mut self) {
let now = SteadyTime::now();
if let Some(mrr) = self.max_refresh_rate {
Expand Down

0 comments on commit cde265b

Please sign in to comment.