Files
bun.sh/src/system_timer.zig
pfg 83760fc446 Sort imports in all files (#21119)
Co-authored-by: taylor.fish <contact@taylor.fish>
2025-07-21 13:26:47 -07:00

28 lines
734 B
Zig

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 const Timer = NewTimer();
const Environment = @import("./env.zig");
const std = @import("std");