title: How to change the way that timer schedules in TimerTask?
body: <p>Here is the code snippet:</p>
  
  <pre><code>Timer t = new Timer();
  TimerTask task = new TimerTask() {
  
      @Override
      public void run() {
          //change the timer rate of scheduleAtFixedRate here
      }
  
  };
  
  //every 10 sec
  t.scheduleAtFixedRate(task, new Date(), 10000);
  </code></pre>
  
  <p>Could anyone tell me how to change the rate of timer to <code>t.scheduleAtFixedRate(task, new Date(), 30000)</code> in method <code>run</code> from <code>TimerTask</code> instance? </p>
  
  <p>Thanks a lot!</p>