Loading bar speed changing on phone

I try to make a bar with loop in IEnumerator. This works fine on my pc, but when i build apk and run it at my phone loop is working more slowly than my pc. What should i do? (i tried while and for loop, all of them gave same result)

  while (valueCurrent < currentValue)
               {
                valueCurrent = valueCurrent + 1;
                ValueText.text = valueCurrent.ToString();
                }

                yield return null;
            }

I suppose you could buy a slower PC, or else buy a faster phone? :slight_smile:

You have written frame-counting code. That’s most likely the source of your discrepancies.

If you want consistent timing, traditionally one works in time (usually seconds) and advances time this way:

elapsedTime += Time.deltaTime;

where elapsedTime is a float