How do I find the frames per second of my game?

Would I use Time.deltaTime somehow? I'd like to find the frames per second of my game in a standalone build, so I can't just look at "Stats" in the Editor.

display the value

1.0f / Time.deltaTime

It'll give you a good approximation of your FPS.

However this will only tell you how many frames per second your frame was running at during the last frame! Consequently, this is very sensitive with even tiny variations in the time it took to render last frame.

Another popular method that might be more accurate, would be to know what was the framerate over a fixed amount of time.

Decide upon this amount of time, and just count how many frames have been rendered during that time:

//Declare these in your class
int m_frameCounter = 0;
float m_timeCounter = 0.0f;
float m_lastFramerate = 0.0f;
public float m_refreshTime = 0.5f;

void Update()
{
    if( m_timeCounter < m_refreshTime )
    {
        m_timeCounter += Time.deltaTime;
        m_frameCounter++;
    }
    else
    {
        //This code will break if you set your m_refreshTime to 0, which makes no sense.
        m_lastFramerate = (float)m_frameCounter/m_timeCounter;
        m_frameCounter = 0;
        m_timeCounter = 0.0f;
    }
}

then display somewhere the value

m_lastFramerate

which will be the average framerate over the refresh time you'd have chosen (here 0.5 second)

More simple:

void OnGUI()
{
	GUI.Label(new Rect(0, 0, 100, 100), (int)(1.0f / Time.smoothDeltaTime));		
}

Old topic, but there is a FPSCounter script in the unity standard assets utility folder…

using System;
using UnityEngine;
using UnityEngine.UI;

namespace UnityStandardAssets.Utility
{
    [RequireComponent(typeof (Text))]
    public class FPSCounter : MonoBehaviour
    {
        const float fpsMeasurePeriod = 0.5f;
        private int m_FpsAccumulator = 0;
        private float m_FpsNextPeriod = 0;
        private int m_CurrentFps;
        const string display = "{0} FPS";
        private Text m_Text;


        private void Start()
        {
            m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod;
            m_Text = GetComponent<Text>();
        }


        private void Update()
        {
            // measure average frames per second
            m_FpsAccumulator++;
            if (Time.realtimeSinceStartup > m_FpsNextPeriod)
            {
                m_CurrentFps = (int) (m_FpsAccumulator/fpsMeasurePeriod);
                m_FpsAccumulator = 0;
                m_FpsNextPeriod += fpsMeasurePeriod;
                m_Text.text = string.Format(display, m_CurrentFps);
            }
        }
    }
}

This is similar to Zero’s answer but has smoothing. Less code than the other smoothed examples:

private float fps = 30f;

void OnGUI()
{
        float newFPS = 1.0f / Time.smoothDeltaTime;
        fps = Mathf.Lerp(fps, newFPS, 0.0005f);
        GUI.Label(new Rect(0, 0, 100, 100), "FPS: " + ((int)fps).ToString());
}

wouldn’t Debug.Log(1/Time.deltaTime); be enough?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class fpsCounter : MonoBehaviour
{
    public TextMeshProUGUI text;
    public int frames;
    private void Start()
    {
        StartCoroutine(d());
    }
    private void Update()
    {
        frames++;
    }
    IEnumerator d()
    {
        yield return new WaitForSeconds(1);
        text.text = frames.ToString();
        frames = 0;
        StartCoroutine(d());
    }
}