summaryrefslogtreecommitdiff
path: root/server/test/vm/example.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-25 09:59:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-25 09:59:22 +0800
commitfffac853964beebbfc1c335984193798a205fb67 (patch)
tree1897edd38aab57c888e0a849d88558335fa26d6a /server/test/vm/example.lua
parentf69f1415d83f161f3d586a0595be7ec408b5b18c (diff)
downloadlua-language-server-fffac853964beebbfc1c335984193798a205fb67.zip
加个基准测试
Diffstat (limited to 'server/test/vm/example.lua')
-rw-r--r--server/test/vm/example.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/test/vm/example.lua b/server/test/vm/example.lua
index 459545fd..3e996e23 100644
--- a/server/test/vm/example.lua
+++ b/server/test/vm/example.lua
@@ -6,7 +6,11 @@ TEST(io.load(ROOT / 'src' / 'core' / 'vm.lua'))
local function testIfExit(path)
local buf = io.load(fs.path(path))
if buf then
- TEST(buf)
+ local clock = os.clock()
+ for _ = 1, 10 do
+ TEST(buf)
+ end
+ print('基准测试耗时:', os.clock() - clock)
end
end
-testIfExit[[D:\Github\lua\testes\constructs.lua]]
+testIfExit(ROOT / 'test' / 'example' / 'vm.lua')