HorseSeaHorse/lib/middleclass/performance/time.lua

14 lines
180 B
Lua
Raw Permalink Normal View History

2021-02-05 20:58:58 -06: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