| ... | ... | @@ -172,10 +172,10 @@ pub fn start(self: *Progress, name: []const u8, estimated_total_items: usize) *N |
| 172 | 172 | /// Updates the terminal if enough time has passed since last update. Thread-safe. |
| 173 | 173 | pub fn maybeRefresh(self: *Progress) void { |
| 174 | 174 | if (self.timer) |*timer| { |
| 175 | | const now = timer.read(); |
| 176 | | if (now < self.initial_delay_ns) return; |
| 177 | 175 | if (!self.update_mutex.tryLock()) return; |
| 178 | 176 | defer self.update_mutex.unlock(); |
| 177 | const now = timer.read(); |
| 178 | if (now < self.initial_delay_ns) return; |
| 179 | 179 | // TODO I have observed this to happen sometimes. I think we need to follow Rust's |
| 180 | 180 | // lead and guarantee monotonically increasing times in the std lib itself. |
| 181 | 181 | if (now < self.prev_refresh_timestamp) return; |