From 6f1a062b6c4427602f9cbb552b23480591d3eac5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 29 Aug 2024 15:19:09 -0700 Subject: [PATCH] timers for start times for later --- src/global.zig | 8 ++++++++ src/sentry.zig | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/global.zig b/src/global.zig index 7ba8ba14c..e8b5c1055 100644 --- a/src/global.zig +++ b/src/global.zig @@ -40,6 +40,14 @@ pub const GlobalState = struct { /// Initialize the global state. pub fn init(self: *GlobalState) !void { + // const start = try std.time.Instant.now(); + // const start_micro = std.time.microTimestamp(); + // defer { + // const end = std.time.Instant.now() catch unreachable; + // // "[updateFrame critical time] \t" + // std.log.err("[global init time] start={}us duration={}ns", .{ start_micro, end.since(start) / std.time.ns_per_us }); + // } + // Initialize ourself to nothing so we don't have any extra state. // IMPORTANT: this MUST be initialized before any log output because // the log function uses the global state. diff --git a/src/sentry.zig b/src/sentry.zig index bf3015798..c7b6f2497 100644 --- a/src/sentry.zig +++ b/src/sentry.zig @@ -20,6 +20,14 @@ pub fn init(gpa: Allocator) !void { // Not supported on Windows currently, doesn't build. if (comptime builtin.os.tag == .windows) return; + // const start = try std.time.Instant.now(); + // const start_micro = std.time.microTimestamp(); + // defer { + // const end = std.time.Instant.now() catch unreachable; + // // "[updateFrame critical time] \t" + // std.log.err("[sentry init time] start={}us duration={}ns", .{ start_micro, end.since(start) / std.time.ns_per_us }); + // } + var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const alloc = arena.allocator();