time.lua 180 B

1234567891011121314
  1. return function(title, f)
  2. collectgarbage()
  3. local startTime = os.clock()
  4. for i=0,10000 do f() end
  5. local endTime = os.clock()
  6. print( title, endTime - startTime )
  7. end