Fix server 100% CPU usage in idle

This commit is contained in:
ChillerDragon 2022-11-09 13:55:09 +01:00
parent d013656ffb
commit ddc6a1ad17

View file

@ -33,6 +33,8 @@ class TeeworldsServer
@netbase.bind(@s)
loop do
tick
# TODO: proper tick speed sleep
sleep 0.001
end
end
@ -102,8 +104,5 @@ class TeeworldsServer
packet.addr.port = client[1]
puts packet.to_s if @verbose
on_packet(packet)
# TODO: proper tick speed sleep
sleep 0.001
end
end