feat: make logview include precision for small tdiff values

This commit is contained in:
CJ van den Berg 2025-04-22 18:00:13 +02:00
parent 2c68c2a00c
commit 5ebd6353b3
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -74,7 +74,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
fn output_tdiff(self: *Self, tdiff: i64) !void { fn output_tdiff(self: *Self, tdiff: i64) !void {
const msi = @divFloor(tdiff, time.us_per_ms); const msi = @divFloor(tdiff, time.us_per_ms);
if (msi == 0) { if (msi < 10) {
const d: f64 = @floatFromInt(tdiff); const d: f64 = @floatFromInt(tdiff);
const ms = d / time.us_per_ms; const ms = d / time.us_per_ms;
_ = try self.plane.print("{d:6.2} ▏", .{ms}); _ = try self.plane.print("{d:6.2} ▏", .{ms});