Skip to content

Commit

Permalink
Minor fix for prime-test.lua.
Browse files Browse the repository at this point in the history
  • Loading branch information
akopytov committed Jun 28, 2017
1 parent 89f7a5e commit 1e0c5b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/lua/prime-test.lua
Expand Up @@ -13,16 +13,17 @@ sysbench.cmdline.options = {
}

function event()
n = 0
local n = 0
for c = 3, sysbench.opt.cpu_max_prime do
t = math.sqrt(c)
l = 2
local t = math.sqrt(c)
local isprime = true
for l = 2, t do
if c % l == 0 then
isprime = false
break
end
end
if l > t then
if isprime then
n = n + 1
end
end
Expand All @@ -34,4 +35,4 @@ function sysbench.hooks.report_intermediate(stat)
stat.time_total,
stat.threads_running,
stat.events / seconds))
end
end

0 comments on commit 1e0c5b8

Please sign in to comment.