| ... | @@ -14,8 +14,8 @@ const c = @cImport({ | ... | @@ -14,8 +14,8 @@ const c = @cImport({ |
| 14 | }); | 14 | }); |
| 15 | const HashFunction = @import("md5.zig").Md5; | 15 | const HashFunction = @import("md5.zig").Md5; |
| 16 | | 16 | |
| 17 | const MB = 1024 * 1024; | 17 | const MiB = 1024 * 1024; |
| 18 | const BytesToHash = 1024 * MB; | 18 | const BytesToHash = 1024 * MiB; |
| 19 | | 19 | |
| 20 | pub fn main() !void { | 20 | pub fn main() !void { |
| 21 | var stdout_file = try std.io.getStdOut(); | 21 | var stdout_file = try std.io.getStdOut(); |
| ... | @@ -37,6 +37,5 @@ pub fn main() !void { | ... | @@ -37,6 +37,5 @@ pub fn main() !void { |
| 37 | const elapsed_s = f64(end - start) / f64(c.CLOCKS_PER_SEC); | 37 | const elapsed_s = f64(end - start) / f64(c.CLOCKS_PER_SEC); |
| 38 | const throughput = u64(BytesToHash / elapsed_s); | 38 | const throughput = u64(BytesToHash / elapsed_s); |
| 39 | | 39 | |
| 40 | try stdout.print("{}: ", @typeName(HashFunction)); | 40 | try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB)); |
| 41 | try stdout.print("{} MB/s\n", throughput / (1 * MB)); | | |
| 42 | } | 41 | } |