Is Time.deltaTime framerate dependent?

Is Time.deltaTime framerate dependent?

I have a game that calculates your score via Time.deltaTime (the more time the more score). On my PC I get about 1200 points if I just idle the game while on my phone I only get about 400 points.
I believe my code must be FPS dependant and that's why my phone is getting a lower score for the same time.
Here's the code:
void Update ()
{
    time += Time.deltaTime;

    score += (int)time;

    timerLabel.text = score.ToString();
}

Sorry if it's something very obvious. I'm quite new at c#.
Can't seem to get the solution to work. It just stays at 0:
Full Code:
    using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;

public class EndGame : MonoBehaviour {

    public Text textWin;
    public Text timerLabel;
    public GameObject retryButton;
    public GameObject points;

    private Vector3 offset;
    private float time;
    private float score;


    void OnTriggerEnter (Collider col) {
        if (col.gameObject.name == "Player") {
            setWinText ();
            retryButton.SetActive (true);
            points.SetActive (false);
        }
    }

    void setWinText () {
        textWin.text = "Final score: " + score.ToString();
    }

    void Update ()
    {
        time += Time.deltaTime;
        if (time >= 1.0f) {
            ++score;
            score -= 1.0f;
        }

        timerLabel.text = score.ToString();
    }

}

Solutions/Answers:

Answer 1:

deltaTime is the (or at least, a) correct thing to be basing a time-based score on. It’s value does vary with the framerate, of course, since it tracks real-time elapsed time between one frame and the next. On faster frames, it will be a smaller value than on slower frames, but it will always measure real time, so it’s basically the thing you want to be using.

How you are using it is wrong, though.

deltaTime is a floating point value, when you cast it to an integer you truncate (drop) the decimal portion of the value. This means that on very fast frames, when deltaTime is less than one, you add zero to the score. On every other frame you add some value to the score, but you’re compounding the error more-or-less randomly.

One way to do this which doesn’t exhibit this issue is to accumulate delta time until it measures one second, and then add one to the score, resetting the accumulator and preserving the factional part of the number. Something like this, conceptually:

void Update() {
   scoreTimer += Time.deltaTime;
   if (scoreTimer >= 1.0f) {
     int integer = (int)scoreTimer;
     score += integer;
     scoreTimer -= integer;
   }

   // ...
}

This will also make the score counter visually increase at the same fixed rate, instead of as fast as your framerate is.

The cast to int is to extract the whole-number part of the accumulator and add that to the score, and then to subtract that whole-number part out of the accumulator so you preserve the accumulation of fractional time. This helps correct for frames that are extremely slow, in excess of one second long. You could also use Math.Round.

References