diff options
Diffstat (limited to 'test/pdf_pointer_bench.zig')
| -rw-r--r-- | test/pdf_pointer_bench.zig | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/test/pdf_pointer_bench.zig b/test/pdf_pointer_bench.zig index f1d61229..ae2de2f5 100644 --- a/test/pdf_pointer_bench.zig +++ b/test/pdf_pointer_bench.zig @@ -15,6 +15,9 @@ //! frame each step settles on. It is the no-regression proof: a change to how highlights //! are painted may change what it costs, never one presented pixel. const std = @import("std"); +const bench_util = @import("bench_util.zig"); +const nowNs = bench_util.nowNs; +const mix = bench_util.mix; const pardes = @import("pardes"); const pdf = @import("mupdf"); @@ -208,17 +211,6 @@ fn print(comptime format: []const u8, args: anytype) void { _ = std.c.write(1, line.ptr, line.len); } -fn mix(seed: u64, value: anytype) u64 { - var copy = value; - return std.hash.Wyhash.hash(seed, std.mem.asBytes(©)); -} - -fn nowNs() u64 { - var ts: std.c.timespec = undefined; - _ = std.c.clock_gettime(.MONOTONIC, &ts); - return @as(u64, @intCast(ts.sec)) * 1_000_000_000 + @as(u64, @intCast(ts.nsec)); -} - comptime { _ = pdf.Document; } |
