How to log the FPS in the console?

Hey forum :slight_smile:
I would like to log the fps of my application in the console so i can use it later (plotting and comparing to other applications). So far i used the stats panel in the top left corner, but i did not manage to extract the fps value out of this so i can log it individually.

Can someone tell me how to get the fps counter in the console? It does not have to be via the stats feature… it could also be something else. But when using the fps = 1000 / (thisLoop - lastLoop) mehtod the results tend to be very jumpy (sometimes 120 and sometimes 40), so the stats might be the way to go with a very stable output.

Thank you! :slight_smile:

Try it like so: three.js - FPS counter - JSFiddle - Code Playground

The FPS computation is based on how stats.js computes its FPS value:

2 Likes

Thank you! Thats great :slight_smile: