diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:05:39 +0930 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-05-29 18:05:39 +0930 |
commit | 9d7bd06ad57832cfe6bba22acc7d7b8c74cdf8b8 (patch) | |
tree | 9a610ad8a7fd239e67e90f839ba88248dfd7b128 | |
parent | 582ea61b9e4452426753272d921651681a1c8937 (diff) | |
download | lua-cjson-9d7bd06ad57832cfe6bba22acc7d7b8c74cdf8b8.tar.gz lua-cjson-9d7bd06ad57832cfe6bba22acc7d7b8c74cdf8b8.tar.bz2 lua-cjson-9d7bd06ad57832cfe6bba22acc7d7b8c74cdf8b8.zip |
Add trivial types.json example
-rwxr-xr-x | tests/bench.lua | 2 | ||||
-rw-r--r-- | tests/types.json | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/bench.lua b/tests/bench.lua index c1808cf..0e2a75c 100755 --- a/tests/bench.lua +++ b/tests/bench.lua | |||
@@ -12,12 +12,14 @@ local json = require "cjson" | |||
12 | 12 | ||
13 | function benchmark(tests, iter, rep) | 13 | function benchmark(tests, iter, rep) |
14 | local function bench(func, iter) | 14 | local function bench(func, iter) |
15 | -- collectgarbage("stop") | ||
15 | collectgarbage("collect") | 16 | collectgarbage("collect") |
16 | local t = socket.gettime() | 17 | local t = socket.gettime() |
17 | for i = 1, iter do | 18 | for i = 1, iter do |
18 | func(i) | 19 | func(i) |
19 | end | 20 | end |
20 | t = socket.gettime() - t | 21 | t = socket.gettime() - t |
22 | -- collectgarbage("restart") | ||
21 | return (iter / t) | 23 | return (iter / t) |
22 | end | 24 | end |
23 | 25 | ||
diff --git a/tests/types.json b/tests/types.json new file mode 100644 index 0000000..c01e7d2 --- /dev/null +++ b/tests/types.json | |||
@@ -0,0 +1 @@ | |||
{ "array": [ 10, true, null ] } | |||