-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_equals.lua
24 lines (21 loc) · 1008 Bytes
/
string_equals.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local start = os.clock()
local count = 0
for i = 1, 1000000 do
if ("abc" == "abc") then count = count + 1 end
if ("a slightly longer string" ==
"a slightly longer string") then count = count + 1 end
if ("a significantly longer string but still not overwhelmingly long string" ==
"a significantly longer string but still not overwhelmingly long string") then count = count + 1 end
if ("" == "abc") then count = count + 1 end
if ("abc" == "abcd") then count = count + 1 end
if ("changed one character" == "changed !ne character") then count = count + 1 end
if ("123" == 123) then count = count + 1 end
if ("a slightly longer string" ==
"a slightly longer string!") then count = count + 1 end
if ("a slightly longer string" ==
"a slightly longer strinh") then count = count + 1 end
if ("a significantly longer string but still not overwhelmingly long string" ==
"another") then count = count + 1 end
end
print(count)
print("elapsed: "..(os.clock() - start))