Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- { API } Created by: Nettoork#0000
- - Run
- average, loops, function
- { EXAMPLE }
- a = {}
- testPerfomance(10, 100000, function(loop)
- a[#a + 1] = loop
- end)
- a = {}
- testPerfomance(10, 100000, function(loop)
- table.insert(a, loop)
- end)
- ]]--
- --[[ Code ]]--
- function testPerfomance(timeLoop, timeLoop2, func)
- local times = 0
- for v = 1, timeLoop do
- local ms = os.time()
- for i = 1, timeLoop2 do
- func(timeLoop2)
- end
- times = times + os.time() - ms
- end
- print('Estimated Time: '..times/timeLoop..' ms.')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement