mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 15:48:21 +00:00
all: type-safe time units
This commit is contained in:
+7
-1
@@ -89,6 +89,12 @@ pub fn log(
|
||||
const ipl = out_lock.acquire_at(.High);
|
||||
defer out_lock.release(ipl);
|
||||
|
||||
writer.interface.print("[{:>5}.{:06}] ", .{ res.info.timestamp / std.time.ns_per_s, (res.info.timestamp % std.time.ns_per_s) / std.time.ns_per_us }) catch return;
|
||||
writer.interface.print(
|
||||
"[{:>5}.{:06}] ",
|
||||
.{
|
||||
res.info.timestamp.value / std.time.ns_per_s,
|
||||
(res.info.timestamp.value % std.time.ns_per_s) / std.time.ns_per_us,
|
||||
},
|
||||
) catch return;
|
||||
_ = writer.interface.writeAll(res.buf[0..res.info.length]) catch return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user