aboutsummaryrefslogtreecommitdiff
path: root/src/system_timer.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-18 17:41:58 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-18 17:41:58 -0700
commit6728551dc4875e5a15cc7353caa4fb862642bc89 (patch)
treea884d7a995fdc463e78e57933bcf488d23153b32 /src/system_timer.zig
parent64a2dda02f7647a506c22057fd4659bd8856ea08 (diff)
downloadbun-6728551dc4875e5a15cc7353caa4fb862642bc89.tar.gz
bun-6728551dc4875e5a15cc7353caa4fb862642bc89.tar.zst
bun-6728551dc4875e5a15cc7353caa4fb862642bc89.zip
Fix wasm build
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();