Showing FPS can be helpful when you’re on a handheld device and gauging performance.
Sometimes you may need to throttle quality for device depending on the performance.
This code is how you display FPS in C# for a mono behaviour script.
Sometimes you may need to throttle quality for device depending on the performance.
This code is how you display FPS in C# for a mono behaviour script.
void Update () {
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
float fps = 1.0f / deltaTime;
Debug.Log(Mathf.Ceil(fps).ToString() + “ FPS”);
}
No comments:
Post a Comment