I’ve asked a very similar question to this here!
I ended up doing this to count the time :))
const start = Io.Clock.real.now(init.io);
_ = doSomeWork();
const end = Io.Clock.real.now(init.io);
const duration = std.Io.Timestamp.durationTo(start, end);
try stdout.print("Time Elapsed: {d} ms\n", .{duration.toMilliseconds()});
I find annoying that there isn’t (or I have not seen ofc) a function in Timestamp to return the seconds as a float (eg, 3.334 s) but it can be easily done!