Many java games use thread.sleep() to controll fps. Since the server does not display graphics, should the server game loop keep running just calculating delta time? Like this example:
long lastLoopTime = System.nanoTime();
final int TARGET_FPS = 60;
final long OPTIMAL_TIME = 1000000000 / TARGET_FPS;
while (gameRunning)
{
long now = System.nanoTime();
long updateLength = now - lastLoopTime;
lastLoopTime = now;
double delta = updateLength / ((double)OPTIMAL_TIME);
doGameUpdates(delta);
}
Thread.Sleep
is the simplest way, some might wait for OS interrupts. You can even count vSync as an sleeping mechanism. \$\endgroup\$