From 5a18bf34c18d837a2d16a80cbf6df767c7fe2981 Mon Sep 17 00:00:00 2001 From: utox39 Date: Mon, 24 Feb 2025 00:29:25 +0100 Subject: [PATCH] feat: add uptime --- src/main.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.zig b/src/main.zig index b42d320..4ea88a5 100644 --- a/src/main.zig +++ b/src/main.zig @@ -18,4 +18,8 @@ pub fn main() !void { try stdout.print("Hostname: {s}\n", .{hostname}); try bw.flush(); allocator.free(hostname); + + const uptime = try os_module.getSystemUptime(); + try stdout.print("Uptime: {} days, {} hours, {} minutes\n", .{ uptime.days, uptime.hours, uptime.minutes }); + try bw.flush(); }