title: Java timer task runs slower than normal
body: <p>Part of an application I'm writing uses a chronometer system. The timer should tick once every ms. </p>
  
  <p>In my chronometer, I have these variables.</p>
  
  <pre><code>    private static final int DELAY_IN_MILLISECONDS = 0;
      private int intervalInMilliseconds = 1;
  </code></pre>
  
  <p>I start the timer like this:</p>
  
  <pre><code>        timer = new Timer();
          timer.schedule(new Task(), DELAY_IN_MILLISECONDS,
              getIntervalInMilliseconds());
  </code></pre>
  
  <p>Yet, after a second he only reached about +- 100ms instead of 1000ms.</p>
  
  <p>Though he used to work fine, untill I've added code to a different part of the game. I'm rather sure I've changed nothing on the timer but yet he became slower than normal (he used to work fine at first).</p>
  
  <p>Is it possible that my timer runs slower due to the application requiring too much CPU time for other things? (it's a game I'm creating). If so, what would be the conventional way to solve this? Keeping in mind that it's more important the game runs smooth than the timer. </p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT: Is there a way to find out which part of your application is "bottlenecking" it, such as check where he uses most resources etc?</p>