From b305389dc741dfe3fb5300d4383ade4cddb2ba3e Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Thu, 27 Jun 2024 01:56:54 -0700 Subject: bench: Fix for Windows and use fmtDuration --- bench/src/ziglyph_codepoint.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bench/src/ziglyph_codepoint.zig') diff --git a/bench/src/ziglyph_codepoint.zig b/bench/src/ziglyph_codepoint.zig index 4c8fc18..4265d97 100644 --- a/bench/src/ziglyph_codepoint.zig +++ b/bench/src/ziglyph_codepoint.zig @@ -3,14 +3,14 @@ const std = @import("std"); const CodePointIterator = @import("ziglyph").CodePointIterator; pub fn main() !void { - var args_iter = std.process.args(); - _ = args_iter.skip(); - const in_path = args_iter.next() orelse return error.MissingArg; - var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const allocator = arena.allocator(); + var args_iter = try std.process.argsWithAllocator(allocator); + _ = args_iter.skip(); + const in_path = args_iter.next() orelse return error.MissingArg; + const input = try std.fs.cwd().readFileAlloc( allocator, in_path, @@ -23,5 +23,5 @@ pub fn main() !void { var timer = try std.time.Timer.start(); while (iter.next()) |_| result += 1; - std.debug.print("Ziglyph CodePointIterator: result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); + std.debug.print("Ziglyph CodePointIterator: result: {}, took: {}\n", .{ result, std.fmt.fmtDuration(timer.lap() / std.time.ns_per_ms) }); } -- cgit v1.2.3