diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-06 11:41:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-06 11:41:16 +0800 |
commit | c4ce0145a7fd35fe1fa628b862e9963ffc8243cc (patch) | |
tree | 425baa86b52999621257c852e617ef460b2fcde0 /server/src/service.lua | |
parent | fea600b2acdf3807504853c967f69aecde086c89 (diff) | |
download | lua-language-server-c4ce0145a7fd35fe1fa628b862e9963ffc8243cc.zip |
加个耗时统计
Diffstat (limited to 'server/src/service.lua')
-rw-r--r-- | server/src/service.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 12ae140b..f2007bda 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -87,8 +87,11 @@ function mt:_doDiagnostic() if not next(self._needDiagnostics) then return end + local clock = os.clock() + local count = 0 local copy = {} for uri, data in pairs(self._needDiagnostics) do + count = count + 1 copy[uri] = data self._needDiagnostics[uri] = nil end @@ -106,6 +109,14 @@ function mt:_doDiagnostic() } end end + local passed = os.clock() - clock + log.debug(('\n\z + Diagnostics completion\n\z + Cost: [%.3f]sec\n\z + Num: [%d]'):format( + passed, + count + )) end function mt:_buildTextCache() |