1
0
forked from Mirror/wren
Files
wren/test/benchmark/map_numeric.lua
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

20 lines
286 B
Lua

local start = os.clock()
local map = {}
for i = 1, 1000000 do
map[i] = i
end
local sum = 0
for i = 1, 1000000 do
sum = sum + map[i]
end
io.write(string.format("%d\n", sum))
for i = 1, 1000000 do
map[i] = nil
end
io.write(string.format("elapsed: %.8f\n", os.clock() - start))