title: How to add a score system in java for an android game
body: <p>I have a game where it has a Start/Stop button. The aim of the game is to see if you can count to 10 in your head. When you press the start button the (invisible)timer starts and when you press stop it should stop the timer and display your score on the page. The closer you get to 10 seconds the better score you get.
  I want to know how I can implement a scoring system for this because it is based on time I don't know how to convert it to an int? Below is the code that makes it run.</p>
  
  <pre><code> private Runnable updateTimerThread = new Runnable() {
  
      public void run() {
  
          timeInMilliseconds = SystemClock.uptimeMillis() - startTime;
  
          updatedTime = timeSwapBuff + timeInMilliseconds;
  
          int secs = (int) (updatedTime / 1000);
          int mins = secs / 60;
          secs = secs % 60;
          int milliseconds = (int) (updatedTime % 1000);
          timerValue.setText("" + mins + ":"
                  + String.format("%02d", secs) + ":"
                  + String.format("%03d", milliseconds));
          customHandler.postDelayed(this, 0);
      }
  
  };
  </code></pre>