diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/common.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/common.lua b/tests/common.lua index d712c83..fd0e805 100644 --- a/tests/common.lua +++ b/tests/common.lua | |||
| @@ -128,12 +128,13 @@ end | |||
| 128 | 128 | ||
| 129 | function benchmark(tests, iter, rep) | 129 | function benchmark(tests, iter, rep) |
| 130 | local function bench(func, iter) | 130 | local function bench(func, iter) |
| 131 | collectgarbage("collect") | 131 | collectgarbage("stop") |
| 132 | local t = gettimeofday() | 132 | local t = gettimeofday() |
| 133 | for i = 1, iter do | 133 | for i = 1, iter do |
| 134 | func(i) | 134 | func(i) |
| 135 | end | 135 | end |
| 136 | t = gettimeofday() - t | 136 | t = gettimeofday() - t |
| 137 | collectgarbage("restart") | ||
| 137 | return (iter / t) | 138 | return (iter / t) |
| 138 | end | 139 | end |
| 139 | 140 | ||
