Unity How to calculate or show FPS

FPS.cs
using UnityEngine;
using System.Collections;
 
public class FPS: MonoBehaviour {
	private float	updateInterval = 0.1f;
	private float 	accum   = 0; // FPS accumulated over the interval
	private int		frames  = 0; // Frames drawn over the interval
	private float 	timeleft; // Left time for current interval
 
	void Start () {		
	}
 
	void Update () {		
	}
 
	void getFps() {
		timeleft -= Time.deltaTime;
		accum += Time.timeScale/Time.deltaTime;
		++frames;
 
		// Interval ended - update GUI text and start new interval
		if( timeleft <= 0.0 )
		{
			// display two fractional digits (f2 format)
			float fps = accum/frames;
			string format = System.String.Format("{0:F2} FPS",fps);
 
			timeleft = updateInterval;
			accum = 0.0F;
			frames = 0;
		}
	}
}
Navigation
Print/export
Toolbox