title: Why is my countdown timer in Android so slow?
body: <p>I'm trying to make a countdown timer in android for use in a small android app. The app will countdown from some number of seconds to 0, upon which it will do some action. I'm using the coundowntimer supplied by android.os.countdowntimer. Here is my code:</p>
  
  <pre><code>/** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.quizlayout);
  
      new CountDownTimer(30000, 1000) {
  
          TextView tx = (TextView) findViewById(R.id.textView2);
  
           public void onTick(long millisUntilFinished) {
               tx.setText("seconds remaining: " + millisUntilFinished / 1000);
           }
  
           public void onFinish() {
               tx.setText("done!");
           }
        }.start();
  }
  </code></pre>
  
  <p>However, this countdown timer is really slow. It takes like 3 real-time seconds for the timer to countdown by one second. I wonder what's going on? The code I have above is more or less copied straight from google (<a href="http://developer.android.com/reference/android/os/CountDownTimer.html" rel="nofollow">CountDownTimer</a>)</p>
  
  <p>Can anyone help me as per why my timer is so slow, and offer a way to speed it up a bit?</p>
  
  <p>(EDIT): I am running this on an emulator, the intel atom x86. I am emulating an android 2.3.3 environment.</p>