BatsAndPray/lib/middleclass/performance/time.lua

14 lines
180 B
Lua
Raw Permalink Normal View History

2020-09-19 01:53:57 -05:00
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