Evaluating performance by measuring max and min frame rates (FPS)
Optimization principal 4: Use performance data to drive design and coding decisions.
A useful raw measurement of game performance is the maximum and minimum frame rate for a section of a game. In this recipe, we make use of a Creative Commons Frames Per Second (FPS) calculation script to record the maximum and minimum frame rates for a game performing mathematics calculations for each frame.
Getting ready
For this recipe, we have provided C# script FPSCounter.cs
in the 1362_11_12
folder. This file is the one we have modified to include the maximum and minimum values based on the Do-It-Yourself (DIY) frame rate calculation script from Annop "Nargus" Prapasapong, kindly published under Creative Commons on the Unify wiki at http://wiki.unity3d.com/index.php?title=FramesPerSecond.
How to do it...
To calculate and record the maximum and minimum FPS, follow these steps:
- Start a new project, and import the
FPSCounter.cs
script...