aboutsummaryrefslogtreecommitdiff
path: root/src/system_timer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/system_timer.zig')
-rw-r--r--src/system_timer.zig27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/system_timer.zig b/src/system_timer.zig
new file mode 100644
index 000000000..993f10e3f
--- /dev/null
+++ b/src/system_timer.zig
@@ -0,0 +1,27 @@
+const Environment = @import("./env.zig");
+const std = @import("std");
+
+fn NewTimer() type {
+ if (Environment.isWasm) {
+ return struct {
+ pub fn start() anyerror!@This() {
+ return @This(){};
+ }
+
+ pub fn read(_: anytype) u64 {
+ @compileError("FeatureFlags.tracing should be disabled in WASM");
+ }
+
+ pub fn lap(_: anytype) u64 {
+ @compileError("FeatureFlags.tracing should be disabled in WASM");
+ }
+
+ pub fn reset(_: anytype) u64 {
+ @compileError("FeatureFlags.tracing should be disabled in WASM");
+ }
+ };
+ }
+
+ return std.time.Timer;
+}
+pub usingnamespace NewTimer();