Pauses execution of the calling thread until the next tick, unless ms was provided, in which case execution will resume once the time has elapsed
function thread.yield(ms: int? --[[0]]): void
-- example usage
local thread1_created = thread.create(function()
while true do
-- runs once every tick
thread.yield()
end
end)
local thread2_created = thread.create(function()
while true do
-- runs once every second
thread.yield(1000)
end
end)