authorgravatar for wilsonk@cpsc.ucalgary.cawilsonk <wilsonk@cpsc.ucalgary.ca> 2018-07-09 15:21:20-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-07-09 17:21:20-04:00
loga2834d48b9480286549fd9882d67e874396eec79
tree2798561c145a3081baa52465965edeaaa94eb595
parent0ac1b83885c7f2a97a8ac25657afcb5c9b80afb4

Update throughput_test.zig. (#1211)


1 files changed, 4 insertions(+), 4 deletions(-)

std/crypto/throughput_test.zig+4-4
...@@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB;...@@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB;
1515
16pub fn main() !void {16pub fn main() !void {
17 var stdout_file = try std.io.getStdOut();17 var stdout_file = try std.io.getStdOut();
18 var stdout_out_stream = std.io.FileOutStream.init(*stdout_file);18 var stdout_out_stream = std.io.FileOutStream.init(&stdout_file);
19 const stdout = *stdout_out_stream.stream;19 const stdout = &stdout_out_stream.stream;
2020
21 var block: [HashFunction.block_size]u8 = undefined;21 var block: [HashFunction.block_size]u8 = undefined;
22 std.mem.set(u8, block[0..], 0);22 std.mem.set(u8, block[0..], 0);
...@@ -31,8 +31,8 @@ pub fn main() !void {...@@ -31,8 +31,8 @@ pub fn main() !void {
31 }31 }
32 const end = timer.read();32 const end = timer.read();
3333
34 const elapsed_s = f64(end - start) / time.ns_per_s;34 const elapsed_s = @intToFloat(f64, end - start) / time.ns_per_s;
35 const throughput = u64(BytesToHash / elapsed_s);35 const throughput = @floatToInt(u64, BytesToHash / elapsed_s);
3636
37 try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB));37 try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB));
38}38}