# You are allowed to redistribute it and sell it, alone or is a part of
# another product.
-# Provides the Clock utility class to keep time of real time flow
+# Services to keep time of the wall clock time
module realtime is ldflags "-lrt"
in "C header" `{
time_at_last_lapse = nt
return dt
end
+
+ # Seconds since the last call to `lapse`, without resetting the lapse counter
+ fun peek_lapse: Float
+ do
+ var nt = new Timespec.monotonic_now
+ var dt = nt - time_at_last_lapse
+ var r = dt.to_f
+ nt.free
+ dt.free
+ return r
+ end
end