examples(pathological): improve printing of time
This commit is contained in:
parent
fc9f55d6fa
commit
2d48093d3a
1 changed files with 4 additions and 3 deletions
|
@ -12,7 +12,7 @@ pub fn main() !void {
|
|||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
const alloc = gpa.allocator();
|
||||
var vx = try vaxis.init(alloc, .{});
|
||||
errdefer vx.deinit(alloc);
|
||||
defer vx.deinit(alloc);
|
||||
|
||||
var loop: vaxis.Loop(Event) = .{ .vaxis = &vx };
|
||||
|
||||
|
@ -54,7 +54,8 @@ pub fn main() !void {
|
|||
}
|
||||
try vx.render();
|
||||
}
|
||||
try vx.exitAltScreen();
|
||||
const took = std.time.microTimestamp() - timer_start;
|
||||
vx.deinit(alloc);
|
||||
log.info("took {d}ms", .{@divTrunc(took, std.time.us_per_ms)});
|
||||
const stdout = std.io.getStdOut().writer();
|
||||
try stdout.print("\r\ntook {d}ms to render 10,000 times\r\n", .{@divTrunc(took, std.time.us_per_ms)});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue