title: java timer task schedule
body: <p>From reading on Stack Overflow I've seen that many of you don't recommend using Timer Task. Hmmm... but I already implemented this:</p>
  
  <p>I have this code:</p>
  
  <pre><code>detectionHandlerTimer.schedule(myTimerTask, 60 * 1000, 60 * 1000);
  </code></pre>
  
  <p>The thing is that work of myTimerTask lasts some time.</p>
  
  <p>I would like this behavior:</p>
  
  <ol>
  <li>wait 60 sec.</li>
  <li>do task for some time (e.g. 40 - 100 sec).</li>
  <li>task finished.</li>
  <li>wait 60 seconds.</li>
  <li>do task for some time (e.g. 40 - 100 sec).</li>
  </ol>
  
  <p>But the code above behaves like this</p>
  
  <ol>
  <li>wait 60 sec.</li>
  <li>do task for some time (e.g. 40 - 100 sec).</li>
  <li>task finished</li>
  <li>do task for some time (e.g. 40 - 100 sec).</li>
  </ol>
  
  <p>Because the time duration of task is bigger than 60, timer starts task immediately after task is finished. But I would like it to wait again.</p>