From e8c317494a24db068fde9cd6d0a29d447e3d11b8 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Wed, 29 Mar 2023 00:33:29 +0200 Subject: [PATCH] Limit `core.threads` without a timeout to run 30 times per second --- data/core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/init.lua b/data/core/init.lua index e11d2568..b14c0104 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1397,7 +1397,7 @@ local run_threads = coroutine.wrap(function() core.threads[k] = nil end else - wait = wait or 0 + wait = wait or (1/30) thread.wake = system.get_time() + wait minimal_time_to_wake = math.min(minimal_time_to_wake, wait) end