diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-02 11:49:44 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-02 11:49:44 +0800 |
commit | 877aebdc2675986fce873272455d3530ce282907 (patch) | |
tree | 05917deeb8cc7fbbaa5586a7f10cbfadb0ff5250 /script-beta | |
parent | 33beca3671744d7d7add8310774a5b01c3392188 (diff) | |
download | lua-language-server-877aebdc2675986fce873272455d3530ce282907.zip |
Revert "后台cpu消耗"
This reverts commit 33beca3671744d7d7add8310774a5b01c3392188.
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/config.lua | 3 | ||||
-rw-r--r-- | script-beta/service/service.lua | 11 |
2 files changed, 0 insertions, 14 deletions
diff --git a/script-beta/config.lua b/script-beta/config.lua index d12107cc..99f701fd 100644 --- a/script-beta/config.lua +++ b/script-beta/config.lua @@ -149,9 +149,6 @@ local ConfigTemplate = { enable = {false, Boolean}, path = {'.vscode/lua-plugin/*.lua', String}, }, - misc = { - backGroundCPU = {10, Integer}, - } } local OtherTemplate = { diff --git a/script-beta/service/service.lua b/script-beta/service/service.lua index 3e912cb7..11cc7b19 100644 --- a/script-beta/service/service.lua +++ b/script-beta/service/service.lua @@ -4,7 +4,6 @@ local await = require 'await' local timer = require 'timer' local proto = require 'proto' local vm = require 'vm' -local config = require 'config' local m = {} m.type = 'service' @@ -134,23 +133,13 @@ function m.report() end function m.startTimer() - local clock = os.clock() while true do ::CONTINUE:: pub.step() if await.step() then - local passed = os.clock() - clock - local cpu = config.config.misc.backGroundCPU - if cpu >= 1 and cpu < 100 then - local sleepRate = (100 - cpu) / cpu - local extraSleep = math.min(passed * sleepRate, 0.1) - thread.sleep(extraSleep) - end - clock = os.clock() goto CONTINUE end thread.sleep(0.001) - clock = os.clock() timer.update() end end |