Skip to content

Commit

Permalink
release(v1.1.6): add date and version to the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sassman committed Jan 30, 2021
1 parent 2c42c87 commit 9acf5f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.1.6] 2021-01-30
### Changed
- remove `rand` crate dependency in favor of more lightweight `fastrand` crate
- little change of time unit presentation, to be more human readable for slow systems like my Raspi
Expand All @@ -26,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.1.1] 2020-05-12
## [1.0.0] 2020-05-07

[Unreleased]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.5...HEAD
[Unreleased]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.6...HEAD
[1.1.6]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.6...v1.1.5
[1.1.5]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.5...v1.1.4
[1.1.4]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.4...v1.1.3
[1.1.3]: https://github.com/sassman/ssd-benchmark-rs/compare/v1.1.3...v1.1.4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ssd-benchmark"
description = "Super Simple Disk Benchmark - benchmarks the writing performance of your disk."
version = "1.1.5"
version = "1.1.6"
authors = ["Sven Assmann <[email protected]>"]
edition = "2018"
license = "GPL-3.0-only"
Expand Down
21 changes: 15 additions & 6 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ impl HumanReadable for Duration {
if self >= &ONE_MIN {
let time = (self.as_secs() / 60) as u128;
let seconds = self.as_secs() - (time * 60) as u64;
return format!("{} m {} {:<4}", time, seconds, "s");
return format!("{} m {} {:<3}", time, seconds, "s");
} else if self >= &ONE_SEC {
return format!("{:>10} {:<4}", self.as_secs_f32().round(), "s");
}
let time = self.as_millis();

format!("{:>10} ms", time)
format!("{:>10} {:<4}", time, "ms")
}
}

Expand Down Expand Up @@ -119,10 +119,19 @@ mod tests {

#[test]
fn should_format_time() {
assert_eq!(Duration::from_secs(100).as_human_readable(), "1m 40s");
assert_eq!(Duration::from_millis(1200).as_human_readable(), "~1s");
assert_eq!(Duration::from_millis(1800).as_human_readable(), "~2s");
assert_eq!(Duration::from_millis(100).as_human_readable(), "100ms");
assert_eq!(Duration::from_secs(100).as_human_readable(), "1 m 40 s ");
assert_eq!(
Duration::from_millis(1200).as_human_readable(),
" 1 s "
);
assert_eq!(
Duration::from_millis(1800).as_human_readable(),
" 2 s "
);
assert_eq!(
Duration::from_millis(100).as_human_readable(),
" 100 ms "
);
}

#[test]
Expand Down

0 comments on commit 9acf5f0

Please sign in to comment.