diff --git a/Cargo.lock b/Cargo.lock index 5a820a7..834f1dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 4 [[package]] name = "snowy_libs" -version = "0.1.0" +version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 1a4a4a0..b826308 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snowy_libs" -version = "0.1.0" +version = "0.1.1" edition = "2024" [dependencies] diff --git a/src/lib.rs b/src/lib.rs index 9b4d501..ca31bac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,13 @@ pub fn start_progress_bar( let remaining_time = (still_todo / time_per_percentage).ceil(); if done == total { - string.push_str(&format!(" {}/{} {}% || done! \n", done, total, procentage)); + string.push_str(&format!( + " {}/{} {}% || in {}s! \n", + done, + total, + procentage, + going_for.round() + )); } else { string.push_str(&format!( " {}/{} {}% || {}s ", @@ -96,7 +102,14 @@ mod tests { let value = Arc::new(AtomicU64::from(0)); - start_progress_bar(&value, 100, 50, "Being silly", now, Duration::from_secs(1)); + start_progress_bar( + &value, + 100, + 50, + "Being silly", + now, + Duration::from_millis(1), + ); for _ in 0..=100 { value.fetch_add(1, Ordering::Relaxed);