diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-12 14:17:31 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-12 14:17:31 +0800 |
commit | 37391cdd8171d70bcdbb90846636c0fb68b67be3 (patch) | |
tree | 44b1f1829607b381537b65f4f3f71ed0d439bc62 /server/src/vm/value.lua | |
parent | 90fede5418b7c612ca18821e4616664acf11783e (diff) | |
download | lua-language-server-37391cdd8171d70bcdbb90846636c0fb68b67be3.zip |
修改计时器
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r-- | server/src/vm/value.lua | 5 |
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)) |