animationtimer javafx
static int speed x ;
// prefered speed to start with = 5;
new AnimationTimer(){
long lastTick = 0;
@Override
public void handle(long now){
if(lastTick == 0 ){
frame();
lastTick = now ;
return;
}
if(now - lastTick > 1000000000 / speed){
frame();
lastTick = now;
}
}
}.start();