ts the timer ts.addTickListener(tl); // tl gets tick notifications ts.removeTickListener(tl); // tl stops getting notifications ts.dispose(); // done using ts If you are not sure what period to set, use the {@link #ScheduledExecutorTimingSource()} constructor which uses a reasonabledefault value of 15 milliseconds.
Tasks submitted to {@link #submit(Runnable)} and calls to registered{@code TickListener} and {@code PostTickListener} objects from this timingsource are always made in the context of a single thread. This thread is the thread created by {@link Executors#newSingleThreadScheduledExecutor()}.
@author Tim Halloran