mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Use uom
This commit is contained in:
1 parent
9ec7a9c920
commit
641451aea6
15 files changed
+459
-443
No files matched your search
+97
-97
@@ -1,7 +1,7 @@
|
||||
use super::Exporter;
|
||||
use crate::benchmark::benchmark_result::BenchmarkResult;
|
||||
use crate::benchmark::measurement::{Measurement, Measurements};
|
||||
use crate::benchmark::quantity::{Byte, Second};
|
||||
use crate::benchmark::quantity::{Information, InformationQuantity, Time, TimeQuantity};
|
||||
use crate::export::asciidoc::AsciidocExporter;
|
||||
use crate::export::orgmode::OrgmodeExporter;
|
||||
use crate::quantity::{byte, second, Information, Time, TimeUnit, Zero};
|
||||
@@ -31,24 +31,24 @@ fn test_markup_export_auto_ms() {
|
||||
command: String::from("sleep 0.1"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.09),
|
||||
time_user: Second::new(0.09),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.09),
|
||||
time_user: Time::from_seconds(0.09),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.10),
|
||||
time_user: Second::new(0.10),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.10),
|
||||
time_user: Time::from_seconds(0.10),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.14),
|
||||
time_user: Second::new(0.14),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.14),
|
||||
time_user: Time::from_seconds(0.14),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -58,24 +58,24 @@ fn test_markup_export_auto_ms() {
|
||||
command: String::from("sleep 2"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.0),
|
||||
time_user: Second::new(2.0),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.0),
|
||||
time_user: Time::from_seconds(2.0),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(3.0),
|
||||
time_user: Second::new(3.0),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(3.0),
|
||||
time_user: Time::from_seconds(3.0),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(4.0),
|
||||
time_user: Second::new(4.0),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(4.0),
|
||||
time_user: Time::from_seconds(4.0),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -130,24 +130,24 @@ fn test_markup_export_auto_s() {
|
||||
command: String::from("sleep 2"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.1),
|
||||
time_user: Second::new(2.1),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.1),
|
||||
time_user: Time::from_seconds(2.1),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.2),
|
||||
time_user: Second::new(2.2),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.2),
|
||||
time_user: Time::from_seconds(2.2),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.3),
|
||||
time_user: Second::new(2.3),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.3),
|
||||
time_user: Time::from_seconds(2.3),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -157,24 +157,24 @@ fn test_markup_export_auto_s() {
|
||||
command: String::from("sleep 0.1"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.1),
|
||||
time_user: Second::new(0.1),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.1),
|
||||
time_user: Time::from_seconds(0.1),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.2),
|
||||
time_user: Second::new(0.2),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.2),
|
||||
time_user: Time::from_seconds(0.2),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.3),
|
||||
time_user: Second::new(0.3),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.3),
|
||||
time_user: Time::from_seconds(0.3),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -229,24 +229,24 @@ fn test_markup_export_manual_ms() {
|
||||
command: String::from("sleep 2"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.1),
|
||||
time_user: Second::new(2.1),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.1),
|
||||
time_user: Time::from_seconds(2.1),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.2),
|
||||
time_user: Second::new(2.2),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.2),
|
||||
time_user: Time::from_seconds(2.2),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.3),
|
||||
time_user: Second::new(2.3),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.3),
|
||||
time_user: Time::from_seconds(2.3),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -256,24 +256,24 @@ fn test_markup_export_manual_ms() {
|
||||
command: String::from("sleep 0.1"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.1),
|
||||
time_user: Second::new(0.1),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.1),
|
||||
time_user: Time::from_seconds(0.1),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.2),
|
||||
time_user: Second::new(0.2),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.2),
|
||||
time_user: Time::from_seconds(0.2),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.3),
|
||||
time_user: Second::new(0.3),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.3),
|
||||
time_user: Time::from_seconds(0.3),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -327,24 +327,24 @@ fn test_markup_export_manual_s() {
|
||||
command: String::from("sleep 2"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.01),
|
||||
time_user: Second::new(2.01),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.01),
|
||||
time_user: Time::from_seconds(2.01),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.02),
|
||||
time_user: Second::new(2.02),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.02),
|
||||
time_user: Time::from_seconds(2.02),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(2.03),
|
||||
time_user: Second::new(2.03),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(2.03),
|
||||
time_user: Time::from_seconds(2.03),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
@@ -354,24 +354,24 @@ fn test_markup_export_manual_s() {
|
||||
command: String::from("sleep 0.1"),
|
||||
measurements: Measurements::new(vec![
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.11),
|
||||
time_user: Second::new(0.11),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.11),
|
||||
time_user: Time::from_seconds(0.11),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.12),
|
||||
time_user: Second::new(0.12),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.12),
|
||||
time_user: Time::from_seconds(0.12),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
Measurement {
|
||||
time_wall_clock: Second::new(0.13),
|
||||
time_user: Second::new(0.13),
|
||||
time_system: Second::zero(),
|
||||
peak_memory_usage: Byte::new(1024),
|
||||
time_wall_clock: Time::from_seconds(0.13),
|
||||
time_user: Time::from_seconds(0.13),
|
||||
time_system: Time::zero(),
|
||||
peak_memory_usage: Information::from_bytes(1024),
|
||||
exit_status: ExitStatus::default(),
|
||||
},
|
||||
]),
|
||||
|
||||
Reference in new issue
Block a user