Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/bench/micro_tests/test_TableInsertion_index_len.lua
2725 views
1
local function prequire(name) local success, result = pcall(require, name); return success and result end
2
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support")
3
4
function test()
5
6
local ts0 = os.clock()
7
8
for i=1,300 do
9
local t = {}
10
for j=1,1000 do
11
t[#t+1] = j
12
end
13
end
14
15
local ts1 = os.clock()
16
17
return ts1-ts0
18
end
19
20
bench.runCode(test, "TableInsertion: t[#t+1]")
21