mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
28 lines
734 B
Zig
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");
|