A simple api for measuring javafx fps.
The idea behind this project is heavily inspired by this Stackoverflow answer. Whilst not the most accurate way of measuring fps, it is a simple way of getting a rough estimate of the fps. It has been used in a similar way in ReactFx.
- Create a new instance of
FpsFx
. If you want to use an average later, pass in the number of frames you want to average over. - Call
setup()
on the instance. - Call
start()
on the instance. - Call
averageFps()
on the instance to get the average fps orlatestFps()
for the latest fps. - Call
stop()
on the instance when you want to stop measuring fps (e.g. when the application is closed).
Depends on. If you're looking for a simple way of measuring fps, then yes. If you're looking for a more accurate way of measuring fps, then no.
- This project is licensed under the DBAD license.
- JavaFx is licensed under the GNU GPL2 license.
- As this project is inspired by this Stackoverflow answer, also checkout James_D's profile.