diff options
author | B14CK313 <jajoblack@gmx.de> | 2021-07-14 16:26:07 +0200 |
---|---|---|
committer | B14CK313 <jajoblack@gmx.de> | 2021-07-14 16:26:07 +0200 |
commit | 5415cd9d07522fbdff23a69ebc0d9eccc26821b3 (patch) | |
tree | 866cda535f12392902d633026aa7ae0d513f9186 /plugins/smallclock.lua | |
parent | 2f1c6d8a1dc2a5a44fc6a0781c551ca50211a769 (diff) | |
download | lite-xl-plugins-5415cd9d07522fbdff23a69ebc0d9eccc26821b3.tar.gz lite-xl-plugins-5415cd9d07522fbdff23a69ebc0d9eccc26821b3.zip |
Fixed smallclock plugin eating cpu
The plugin uses coroutines but did not yield a value, thus the coroutine
was called way more often than necessary
Fixed it by simply yielding 1, so it only gets called once per second
Diffstat (limited to 'plugins/smallclock.lua')
-rw-r--r-- | plugins/smallclock.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/smallclock.lua b/plugins/smallclock.lua index 8742b07..5c76160 100644 --- a/plugins/smallclock.lua +++ b/plugins/smallclock.lua @@ -9,7 +9,7 @@ core.add_thread(function() while true do local t = os.date("*t") time = string.format("%02d:%02d", t.hour, t.min) - coroutine.yield() + coroutine.yield(1) end end) |