Is it just me, or is the documentation for java.util.TimerTask
(http://java.sun.com/j2se/1.5.0/docs/api/index.html?overview-summary.html) a
little scant?
How do set the interval? How do schedule when it runs? I read examples on
web that show using schedule()? Where is the spec for the schedule method
in the docs?
In the past I have just used a normal thread, then did a sleep(MY_INTERVAL)
at the bottom of the run() method. So it looks like TimerTask may be
exactly what I want.
If I specify an interval for my task to run at, say 5 seconds, will it run
the task every 5 seconds, or 5 seconds between runs.
i.e., What happens if my run() takes 8 seconds, but the timerTask is
scheduled at a 5 second interval?
Thanks,
~S
Ryan Stewart - 07 Apr 2005 12:51 GMT
> Is it just me, or is the documentation for java.util.TimerTask
> (http://java.sun.com/j2se/1.5.0/docs/api/index.html?overview-summary.html) a
[quoted text clipped - 12 lines]
> i.e., What happens if my run() takes 8 seconds, but the timerTask is scheduled
> at a 5 second interval?
Read the java.util.Timer docs instead.
Shea Martin - 07 Apr 2005 16:23 GMT
>>Is it just me, or is the documentation for java.util.TimerTask
>>(http://java.sun.com/j2se/1.5.0/docs/api/index.html?overview-summary.html) a
>>little scant?
>
> Read the java.util.Timer docs instead.
Thanks.