Java Snake Game avoiding using Thread.sleep
问题 I made my first game in Java - Snake, it's main loop looks like this while (true) { long start = System.nanoTime(); model.eUpdate(); if (model.hasElapsedCycle()) { model.updateGame(); } view.refresh(); long delta = (System.nanoTime() - start) / 1000000L; if (delta < model.getFrameTime()) { try { Thread.sleep(model.getFrameTime() - delta); } catch (Exception e) { e.printStackTrace(); } } } But in my project's requirments there is a responsivity point, so I need to change the Thread.sleep()