This content has been marked as final. Show 9 replies
Hi Michael. I think stage.show() is the most time-consuming operation.
I would do it like this:
Calendar start = new GregorianCalendar(); primaryStage.show(); Calendar end = new GregorianCalendar(); System.out.println(end.getTimeInMillis() - start.getTimeInMillis());
The JavaFX team use a tool called Aurora for performance measurements - you could ask about it on the open-jfx mailing list if you are interested in it.
I think, .getMillis() is not enough
Granularity of this method is about 15 millisecond on Windows ( and other OS's too, i'm sure )
You can use AnimationTimer. Its handle method is called once on each frame. By averaging the frames per second, you can gauge the relative performance of your code.1 person found this helpful
I thought that AnimationTimer try to keep FPS constant?
Thanks. I tried it via AnimationTimer and it seems to work.
The fps rate is throttled, which means it will be constant under normal load (usually around 60 fps). But if you put enough pressure on the system, the fps rate will drop and AnimationTimer is the perfect class to measure that.1 person found this helpful
Regarding FPS, PerformanceTracker can be useful:1 person found this helpful
PerformanceTracker perfTracker = PerformanceTracker.getSceneTracker(scene);
This would be exactly what I need if it had a min/max FPS property.