diff options
-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 |