This commit is contained in:
Igor Katson 2024-08-21 16:20:46 +01:00
parent ad5f62b9b9
commit 3067ad21d5
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 19 additions and 18 deletions

View file

@ -19,6 +19,12 @@ pub struct SpeedEstimator {
time_remaining_millis: AtomicU64,
}
impl Default for SpeedEstimator {
fn default() -> Self {
Self::new(5)
}
}
impl SpeedEstimator {
pub fn new(window_seconds: usize) -> Self {
assert!(window_seconds > 1);