Hey guys, I’m making a multiplayer game with a packet system and interpolation for its loops, everything works great and no speed issues, but it literally uses 183% of my CPU, while other Java based games (minecraft, etc) use virtually nothing comparatively. I’ve tried several different implementations of Thread.sleep() but I can’t do a sleep for longer than a few ms, so my cpu reduction is minimal. Any ideas? (Code below is the game loop class, there are also two other threads running the packet system (two while loops, one stuck on input.read until a packet comes in and the other checking an array of packets)
http://pastebin.java-gaming.org/8e5d9385d6d
EDIT: I can’t do a long sleep because it will disrupt the game loop.