FPS (frames per second or frame rate) is very important in computer graphics programming to determine the performance of your game or program. Usually the best FPS is around 60(monitor refrash rate is usually at 60 hz) but you can go down to 30 FPS without notice big changes in performance. Below 25-30 FPS things get worse and you notice stuttering which is annoying . Based on FPS you can also do some comparison between hardware components.
Now to compute JS “FPS” you must count the number of frames(n) processed over a time period(t). The time period is 1 second (1000 ms), you can experiment with other intervals but 1 avoids division.
FPS = n/t=n/1=n;
Beside FPS you should compute the number of milliseconds it takes to process the frames, because FPS cand give misleading results. If frame rate drops from let’s say from 400(2.5ms to render) to 200(5ms to render) and from 60( 16.66 ms ) to 30 ( 33.33 ms ) FPS you will say …wow what a huge difference between 400 and 200 FPS . In bouth cases the number of milliseconds doubled.
There are some cool tools that you can use to show you FPS and ms with some graphic history. I like stats.js very much, also if you are using chrome check chrome’s FPS by activating chrome://flags/ (in your url bar). Also I included here webgl-utils.js which I use in my projects. There are other versions of this on the internet, I like to use this because it is simple. But you can check Paul Irish post about this topic or Source code from Gman. Also check WebGL Stats