summaryrefslogtreecommitdiff
path: root/server/src/vm/value.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-12 14:17:31 +0800
committersumneko <sumneko@hotmail.com>2019-04-12 14:17:31 +0800
commit37391cdd8171d70bcdbb90846636c0fb68b67be3 (patch)
tree44b1f1829607b381537b65f4f3f71ed0d439bc62 /server/src/vm/value.lua
parent90fede5418b7c612ca18821e4616664acf11783e (diff)
downloadlua-language-server-37391cdd8171d70bcdbb90846636c0fb68b67be3.zip
修改计时器
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r--server/src/vm/value.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 9ffd55bc..7eb7784e 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -410,6 +410,7 @@ function mt:addInfo(tp, source, ...)
end
function mt:eachInfo(callback)
+ local clock = os.clock()
local infos = self._info
local list = {}
for srcId, info in pairs(infos) do
@@ -426,6 +427,10 @@ function mt:eachInfo(callback)
table.sort(list, function (a, b)
return a._sort < b._sort
end)
+ local passed = os.clock() - clock
+ if passed > 0.1 then
+ log.warn(('eachInfo takes: [%.3f]sec, #list: %d'):format(passed, #list))
+ end
for i = 1, #list do
local info = list[i]
local res = callback(info, listMgr.get(info.source))