If you are using
Java 5 and above, then the
ScheduledThreadPoolExecutor class is probably what you want. Otherwise, you could also try the
Timer class. Both of these support the capability of starting a
thread at a particular time.
As for stopping such a thread, I am afraid it will have to be cooperative -- you will need to have your code check, and return, when the finish time arrives.
Henry