]> git.proxmox.com Git - proxmox-backup.git/commitdiff
cipherbench: align/format output nicely
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 17 Dec 2019 07:49:34 +0000 (08:49 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 17 Dec 2019 07:49:34 +0000 (08:49 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/bin/cipherbench.rs

index 7238c09b0c2eded82d40949bb6d3bc7db8476cac..5bf147eabb03d050ce55d228644e7deaf0e3dff4 100644 (file)
@@ -4,6 +4,8 @@ use failure::*;
 
 fn rate_test(name: &str, bench: &dyn Fn() -> usize) {
 
+    print!("{:<20} ", name);
+
     let start = std::time::SystemTime::now();
     let duration = std::time::Duration::new(1, 0);
 
@@ -19,7 +21,7 @@ fn rate_test(name: &str, bench: &dyn Fn() -> usize) {
     let elapsed = (elapsed.as_secs() as f64) +
         (elapsed.subsec_millis() as f64)/1000.0;
 
-    println!("{} {} MB/s", name, (bytes as f64)/(elapsed*1024.0*1024.0));
+    println!("{:>8.1} MB/s", (bytes as f64)/(elapsed*1024.0*1024.0));
 }