From 70abae4a3f0492e433a68dd368e139455e9f2d97 Mon Sep 17 00:00:00 2001 From: gliptic Date: Thu, 30 Apr 2026 14:31:34 +0200 Subject: [PATCH] fix: 100% CPU use in App.run durationTo is inverted, making it a busy loop. --- src/vxfw/App.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vxfw/App.zig b/src/vxfw/App.zig index 355ad24..0220c6b 100644 --- a/src/vxfw/App.zig +++ b/src/vxfw/App.zig @@ -112,7 +112,7 @@ pub fn run(self: *App, widget: vxfw.Widget, opts: Options) anyerror!void { while (true) { const now = std.Io.Timestamp.now(self.io, .real); - const duration = next_frame.durationTo(now); + const duration = now.durationTo(next_frame); if (duration.nanoseconds <= 0) { // Deadline exceeded. Schedule the next frame next_frame = now.addDuration(tick); -- 2.51.2