reduce CPU usage in while loop -
how limit cpu of while loop? (cpu usage 100%)
in case, code inside while loop:
sub start() listenerthread = new thread(addressof listen) listenerthread.isbackground = true listenerthread.start() end sub enter code here sub listen() try listener = new tcplistener(new ipendpoint(ipaddress.any, port)) listener.start() a: while (true) thread.sleep(600) dim c new connection(listener.accepttcpclient) addhandler c.gotinfo, addressof gotinfo addhandler c.disconnected, addressof disconnected end while catch ex exception goto end try end sub
Comments
Post a Comment