From c1adfb55d2872216b799a9d9213a8b4130ac6ed5 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 c36704ef..8d83bd59 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