Time.deltaTime Accuracy and Best Practice

Well, I’m writing some code for a mobile game I’m working on for a company. The game has a timer that counts down from 60 and stops at 0. I’ve realize that on some devices, the timer either goes slower or faster than it should. I’d like to know if my code is an OK method of doing a timer. I must say, however, that this is the first I’ve ever encountered such an anomaly with regard to my timers. This is how I’d normally do it and I’ve never had any issues prior to this. The way the code was written is as follows:

#pragma strict

var timer: float = 60;
var displayTimer: UI.Text;

function FixedUpdate(){
    displayTimer.text = timer.ToString("F1");
    Timer();
}

function Timer(){
    timer = timer - Time.deltaTime;
}

I’ve seen some really good answers on here. The timer doesn’t really matter much to the game I’m making, but I think it’d be a nice learning experience to see some other methods of doing things; not just for myself, but for anyone else who may stumble across this and read your responses.

deltaTime doesn’t belong in FixedUpdate() or functions which are invoked during FixedUpdate(). Use Time.fixedDeltaTime instead. Incidentally, this value is equivalent to the physics timestep.

This may be the source of the discrepancy you’re witnessing.