Issues with using a timer in Java. The timer will not update
<p>Hey guys , thanx for the previous help Before I try to explain my problem, you guys need to know what the code is about. Its pretty much "To write a game in which a user is to guess a random number between 1 and 1000. The program should read a number from the keyboard, and print whether the guess was too high, too low or correct. When the user has guessed correctly, the program prints out the numbe of guesses made and time and the playername.When a game is started the program must print the entire high score list, sorted by the number of guesses in ascending"</p>

<p>The Issue is when playing the game and  when you manage to get the correct answer it doesn't show the time  but when the highscore is printed it shows there, Whats up with that because tried to change the boolean statement but that didn't see to work. Here is an illustration of the problem: </p>

<pre><code>You guessed 2 times in 0 seconds.
Please enter your name.
gert
Want to go again?(y/n).....n
HighScore:
Tries        Time       Name
1             35        b
2             6         gert
</code></pre>

<p>SO basically I'm pretty stuck, I was hoping that u guys could give me some pointers or some kind of help so I could fix the problem,,,,, Any help is appreciated.... BTW this is my first program, basically still in the learning phase So take it easy with the comments. The code is  provided below:</p>

<pre><code>import java.util.*;
import java.util.Scanner.*;
import java.util.ArrayList.*;
import java.util.Collections.*;


public class Main {
private static void start() {


 int tries = 0 ;

 int guess = -1;
 String name ;
 String quit = "quit";
 String y = "yes";
 String n = "no";
 String currentGuess;


 String another = ("y") ;
 Scanner input = new Scanner (System.in);

ArrayList&lt;Integer&gt; score = new ArrayList&lt;Integer&gt;();
ArrayList&lt;Long&gt; tg = new ArrayList&lt;Long&gt;();
ArrayList&lt;String&gt; playern = new ArrayList&lt;String&gt;();



boolean a=false;

  do {
      a=false;
     int answer = (int) (Math.random() * 1000 + 1) ;
    System.out.println( " Welcome to Guessing Game " )  ;
    System.out.print("Please enter a number between 1 and 1000 : ");
                    currentGuess = input.nextLine();
            long startTime = System.currentTimeMillis();


      do
      {


               if (currentGuess.equalsIgnoreCase(quit))
        {
            System.out.println("Leaving Us So Soon?");
            System.exit(0);
        }

               try    {
            guess = Integer.parseInt(currentGuess);
              } catch (NumberFormatException nfe) 
                        {
            System.out.println(" Dude Can You Read, Only Digits ");
                        currentGuess = input.nextLine();
                        continue;



            }

        if (guess &lt; 1 || guess &gt; 1000)
        {
            System.out.println("Stupid Guess I Wont Count That.");
                        currentGuess = input.nextLine();
                        continue;
        }

       if (guess &lt; answer )
          {
            System.out.println("too low "+answer);
            currentGuess = input.nextLine();
                        tries++;
        }


    else if(guess  &gt; answer )
        {
            System.out.println("too high "+answer);
            currentGuess = input.nextLine();
                        tries++;
        }


    else if (guess == answer)
        {       
            //stop stop watch
            long endTime = System.currentTimeMillis();
            //calculate game time
            long gameTime = endTime - startTime;
                        gameTime = (gameTime/1000);
            System.out.println("You Rock Dude, Good Job!");


                        System.out.println("You guessed " + tries + " times in " + (int)(gameTime/1000) + " seconds.");
                        System.out.println("Please enter your name.");
                          name = input.nextLine();

                          score.add(tries) ;
                          playern.add(name);
                          tg.add(gameTime);

                          for ( int g=0; g &lt; score.size()-1; g++){
                              for ( int b=g+1; b &lt; score.size(); b++){
                                  if (score.size()&gt;1){
                                  if  (score.get (g) &gt; score.get (b)){
                                    Collections.swap(score, g, b);
                                    Collections.swap(playern, g, b);
                                    Collections.swap(tg, g, b);

                                  }
                                  }
                                  if (score.get (g)==score.get(b) &amp;&amp; tg.get (g) &gt; tg.get(b))
                                  {
                                    Collections.swap(score, g, b);
                                    Collections.swap(playern, g, b);
                                    Collections.swap(tg, g, b);
                                  }
                              }

                          }



             boolean s = false  ; 
             while (s==false)
              {


                     System.out.print("Want to go again?(y/n).....");
                     currentGuess = input.nextLine();
                      if (currentGuess.matches("y"))
            {

                        System.out.println("HighScore:");
                        System.out.println("Tries\tTimentName");
                     for (int j=0; j&lt;score.size(); j++){
                    System.out.println(score.get(j) +"\t"+tg.get(j)+ "\t"+playern.get(j));
                            }


                }

                     s=true;

            }

                     //if user doesn't want to play again

                             if (currentGuess.matches("n"))
                             { System.out.println("HighScore:");
                               System.out.println("Tries\tTime\t\tName");
                for (int j=0; j&lt;score.size(); j++){
                System.out.println(score.get(j) +"\t"+tg.get(j)+ "\t"+playern.get(j));
                            }


                                System.out.println("Thanx For Playing.");
                a=true;

                                s=true;
                                 System.exit(0);  
                    } 
       }



        } while (guess != answer);

  }while(a==false);

}

public static void main(String[] args) {
    Main.start();
    }
}
</code></pre>
