12 Replies Latest reply on May 22, 2012 8:26 AM by Patcha

    timer.scheduleAtFixedRate can stack?

    Patcha
      Hi all, I'm using the following code in the <tt>main()</tt> of a <tt>Frame</tt> extending class:
      Timer timer = new Timer();
      timer.scheduleAtFixedRate(new TimedRefresh(), 50, 50);
      The question is: how can I be sure that the task will not repeat itself after 50 millis, before the old call of "<tt>run()</tt>" ends up calculations?

      Praticall in the run() there are stuffs which can take different time to be made, so I don't wanna lower the time it repeats the task.
      But when it takes longer, I wanna be sure a new task will not being started.

      <tt>Timer</tt> and <tt>TimedRefresh</tt> already supports this?

      Thank you!