diff options
Diffstat (limited to 'server/test/full')
-rw-r--r-- | server/test/full/example.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/test/full/example.lua b/server/test/full/example.lua index cf23335c..2a84de2a 100644 --- a/server/test/full/example.lua +++ b/server/test/full/example.lua @@ -7,10 +7,18 @@ local function testIfExit(path) local buf = io.load(fs.path(path)) if buf then local clock = os.clock() - for _ = 1, 10 do + local max = 100 + local need + for i = 1, max do TEST(buf) + local passed = os.clock() - clock + if (passed >= 1.0 and i >= 3) or i == max then + need = passed / i + break + end end - print('基准测试耗时:', os.clock() - clock) + print(('基准测试[%s]单次耗时:%.10f'):format(path:filename():string(), need)) end end testIfExit(ROOT / 'test' / 'example' / 'vm.txt') +testIfExit(ROOT / 'test' / 'example' / 'largeGlobal.txt') |