### 3.2.2. Use frame time instead of FPS for measurements

Frames per second is a simple and basic measurement of performance, but frame time is a better measure of optimization effectiveness.

The reason frame time is a better measurement is that frame time is a linear measure whereas frames per second is non-linear. Linear measurements also make calculations easier.

Figure 3.2 shows frames per second plotted against frame time. This graph illustrates the non-linear nature of FPS measurements.

Figure 3.2. Frame time and FPS

If you know the individual time changes corresponding to different optimizations, you can add the times together to get the total improvement.

If you are using FPS as a measurement, you cannot add them together because their non-linear nature. Any attempt to add them gives an incorrect total.

Table 3.1 shows a series of comparisons between different FPS measurements A and B.

The FPS changes by a different amount for every measurement, but the frame time changes by the same amount every time. For example, going from 100 FPS to 200 FPS involves a difference of 100 FPS or 5ms. However going from 20 FPS to 22.2 FPS is a difference of 2.2 FPS but this is also 5ms. The linear nature of frame time is easier to work with when you are measuring the impact of optimizations.

Table 3.1. Difference between frames per second and frame time

Frame time AFPS AFrame time BFPS AFPS differenceFrame time difference
70ms14.365ms15.41.15ms
60ms16.755ms18.21.55ms
50ms2045ms22.22.25ms
40ms2535ms28.63.65ms
30ms33.325ms406.75ms
25ms4020ms50105ms
20ms5015ms66.616.65ms
15ms66.610ms10033.45ms
10ms1005ms2001005ms