commit a2834d48b9480286549fd9882d67e874396eec79 (tree)
parent 0ac1b83885c7f2a97a8ac25657afcb5c9b80afb4
Author: wilsonk <wilsonk@cpsc.ucalgary.ca>
Date: Mon, 9 Jul 2018 15:21:20 -0600
Update throughput_test.zig. (#1211)
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/std/crypto/throughput_test.zig b/std/crypto/throughput_test.zig
@@ -15,8 +15,8 @@ const BytesToHash = 1024 * MiB;
pub fn main() !void {
var stdout_file = try std.io.getStdOut();
- var stdout_out_stream = std.io.FileOutStream.init(*stdout_file);
- const stdout = *stdout_out_stream.stream;
+ var stdout_out_stream = std.io.FileOutStream.init(&stdout_file);
+ const stdout = &stdout_out_stream.stream;
var block: [HashFunction.block_size]u8 = undefined;
std.mem.set(u8, block[0..], 0);
@@ -31,8 +31,8 @@ pub fn main() !void {
}
const end = timer.read();
- const elapsed_s = f64(end - start) / time.ns_per_s;
- const throughput = u64(BytesToHash / elapsed_s);
+ const elapsed_s = @intToFloat(f64, end - start) / time.ns_per_s;
+ const throughput = @floatToInt(u64, BytesToHash / elapsed_s);
try stdout.print("{}: {} MiB/s\n", @typeName(HashFunction), throughput / (1 * MiB));
}