Pop.Box/lib/middleclass/performance/time.lua
2017-10-10 00:20:36 -07:00

14 lines
180 B
Lua

return function(title, f)
collectgarbage()
local startTime = os.clock()
for i=0,10000 do f() end
local endTime = os.clock()
print( title, endTime - startTime )
end