fix 'timeit' in headless mode
This commit is contained in:
@@ -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
|
||||
|
||||
------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user