fix 'timeit' in headless mode

This commit is contained in:
MihailRis
2024-12-11 14:08:24 +03:00
parent c67f158e62
commit b05c2fc911
4 changed files with 5 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@ if test then
test.new_world = core.new_world
test.close_world = core.close_world
test.reconfig_packs = core.reconfig_packs
test.tick = coroutine.yield
end
------------------------------------------------
+2 -2
View File
@@ -34,11 +34,11 @@ end
function timeit(iters, func, ...)
local tm = time.uptime()
local tm = os.clock()
for i=1,iters do
func(...)
end
print("[time mcs]", (time.uptime()-tm) * 1000000)
print("[time mcs]", (os.clock()-tm) * 1000000)
end
----------------------------------------------