I have a countdown timer in my code. This countdown timer is supposed to tick every 10ms, and up a textview's number by 1 until it reaches the users score they got during the game.
It's not even reaching half of the value. Here is my code:
new CountDownTimer(lastScore*10, 10) {
public void onTick(long millisUntilFinished) {
tempScore++;
TextView lg = (TextView)findViewById(R.id.lastgame);
lg.setText("LAST SCORE: " + String.valueOf(tempScore));
lg.setTypeface(eightBitFont);
}
public void onFinish() {
}
}.start();
Lastscore is the score they got during the game. tempScore is just used to store the new value to change the textview to.
EDIT: A user pointed out that 10ms might be too fine of a resolution. With 10ms resolution, I had a lastScore value of 115, and tempScore only got up to 46. Changing it to 30ms, I got up to 108 or so, and changing it to 50 has gotten me even closer. It seems I'm going to have to use a value of 100ms ticks to get it to be the right value. But that's a bit slow for what I want to achieve. Is there a better way to do what I'm looking to achieve?