forked from prometheus-lua/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark.lua
More file actions
34 lines (29 loc) · 734 Bytes
/
benchmark.lua
File metadata and controls
34 lines (29 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
print("PROMETHEUS Benchmark")
print("Based On IronBrew Benchmark")
local Iterations = 100000
print("Iterations: " .. tostring(Iterations))
print("CLOSURE testing.")
local Start = os.clock()
local TStart = Start
for Idx = 1, Iterations do
(function()
if not true then
print("Hey gamer.")
end
end)()
end
print("Time:", os.clock() - Start .. "s")
print("SETTABLE testing.")
Start = os.clock()
local T = {}
for Idx = 1, Iterations do
T[tostring(Idx)] = "EPIC GAMER " .. tostring(Idx)
end
print("Time:", os.clock() - Start .. "s")
print("GETTABLE testing.")
Start = os.clock()
for Idx = 1, Iterations do
T[1] = T[tostring(Idx)]
end
print("Time:", os.clock() - Start .. "s")
print("Total Time:", os.clock() - TStart .. "s")