You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
423 B
19 lines
423 B
local function f()
|
|
local tm = os.clock()
|
|
local o: integer = 0
|
|
for j = 1, 10000 do
|
|
local x: integer = 0
|
|
for k = 1, 100000 do
|
|
x = x ~ (j + k)
|
|
end
|
|
o = o | x
|
|
end
|
|
print(" Result = "..o)
|
|
print(" CPU time = "..(os.clock() - tm))
|
|
end
|
|
print"Benchmarking non-compiled function"
|
|
f()
|
|
print"Compiling the function"
|
|
assert(ravi.compile(f))
|
|
print"Benchmarking compiled function"
|
|
f() |