Merge branch 'main' into resumable-intermediates

This commit is contained in:
2026-08-22 20:55:17 -06:00
3 changed files with 280 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
local timing = {}
function timing.timer()
return setmetatable({
entries = {},
}, timing)
end
function timing:start()
-- if not self then self = {} end
self.entries[#self.entries + 1] = { start_time = os.time() }
end
function timing:stop()
local entry = self.entries[#self.entries]
entry.stop_time = os.time()
-- delta in minutes, floored to tenths
return math.floor( (entry.stop_time - entry.start_time) / 60 * 10 ) / 10
end
return timing