From 45f3fa18605bbba9bda6db638fa89df5ae58871a Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sun, 8 Jan 2023 20:06:59 +0100 Subject: [PATCH] Next video: minimal timer library. --- zig-impl/next-video.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zig-impl/next-video.md b/zig-impl/next-video.md index 9a05c88..3c04295 100644 --- a/zig-impl/next-video.md +++ b/zig-impl/next-video.md @@ -34,3 +34,9 @@ # Errors Double returning type => no need for specific return structures. + +# Timer + + const Timer = std.time.Timer; + var timer = try Timer.start(); + var duration = timer.read() / 1000000; // ns -> ms