Limit `core.threads` without a timeout to run 30 times per second

This commit is contained in:
Guldoman 2023-03-29 00:33:29 +02:00
parent 3306fc99c1
commit e8c317494a
No known key found for this signature in database
GPG Key ID: EA928C8BDA1A8825
1 changed files with 1 additions and 1 deletions

View File

@ -1397,7 +1397,7 @@ local run_threads = coroutine.wrap(function()
core.threads[k] = nil core.threads[k] = nil
end end
else else
wait = wait or 0 wait = wait or (1/30)
thread.wake = system.get_time() + wait thread.wake = system.get_time() + wait
minimal_time_to_wake = math.min(minimal_time_to_wake, wait) minimal_time_to_wake = math.min(minimal_time_to_wake, wait)
end end