Good GameLoop for JavaFx AnimationTimer

hello, im using javaFX AnimationTimer for my game loop, i would like to know if there is another way to improve it, docs say that AnimTimer will run at 60 FPS or will try, below is my gameloop:

 gameThread = new AnimationTimer() 
        {

            @Override
            public void handle( long now )
            {
                //not to run if level is nul
                if( null == currentLevel ){return;}
                
                //getting delta
                delta = ( float ) ( ( now - pastTick ) / 1e9 ) ;
                
               update( delta );
               render();
               
               pastTick = now;
                
            }//
            
        };

Looks good to me!

Here are my two comments, based on still limited experience.

It hadn’t occurred to me that at 60 fps, the individual frames might not be evenly spread out. I’m curious what the range of deltas will be. I’ve recently started work (part time) on a new game and when I get to the game loop, I will run some tests on this.

If the deltas are “close enough” then having each frame be an integer increment does significantly reduce the amount of computation involved per frame. As always, we have to try and weigh the trade-offs.

Second comment: so far, it seems to me that having separate update() and render() sections is may be a bit artificial with JavaFX. I’m curious what others think.

Let’s say we have a model and a display object. “Updating” the model makes sense as a step. But suppose the image to be displayed is held in an ImageView. When we update the location coordinates of the ImageView, are we “updating” or are we “rendering”? Also, there are ways that graphical objects can be bound to the model layer, and thus not even require updating.

In any event, this seems quite good enough to get going. I’d be willing to assume that if further refinements are needed, they will make themselves known and won’t be too difficult to refactor in.