Do you have to lock when you have high fps?

133402-aaaa.png

I’m sorry it may sound stupid.

could locking fps bring some performance?

if I didn’t lock it, it may skyrocket like the image but it could be lower than 30fps in older devices right?

float deltaTime = 0.0f;

    void Update() {
        deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;

        print("Unscaled DeltaTime : " + Time.unscaledDeltaTime);
        print("Time DeltaTime : " + Time.deltaTime);
    }

    void OnGUI() {
        int w = Screen.width, h = Screen.height;

        GUIStyle style = new GUIStyle();

        Rect rect = new Rect(0, 0, w, h * 2 / 100);
        style.alignment = TextAnchor.UpperLeft;
        style.fontSize = h * 25 / 100;
        style.normal.textColor = new Color(0.0f, 0.0f, 0.5f, 1.0f);



        float msec = deltaTime * 1000.0f;
        float fps = 1.0f / deltaTime;
      

        string text = string.Format("{0:0.0} ms ({1:0.} fps)", msec, fps);
        GUI.Label(rect, text, style);
    }

also I got this snippet from internet but it doesn’t match with Statistics’ frame rate

I almost finished my first game for mobile and haven’t thought about fps.

all the articles I found are about optimization or what fps is.

I hope someone clear some confusion in my head about when to lock fps or leave it as it is

Thank you very much!

locking fps will not bring better performance, but will make the device save battery since the cpu work will be lower. if what you are looking is some sort of a more “stable” fps app, you may want to check sustained performance mode in the player settings, and read the description to check if it fits with your project.