Timer Class

Used to schedule tasks for future execution in a background thread. Tasks may be scheduled for one-time execution, or for repeated execution at regular intervals. Unlike the java.util.Timer class, this implementation does not silently cancel tasks if a task encounters an exception.

Constructors

Timer( )

Public Methods

schedule( Runnable task, long delay ) returns void
Schedules the specified task for execution after the specified delay.
task task to be scheduled.
delaydelay in milliseconds before task is to be executed.
schedule( Runnable task, java.util.Date time ) returns void
Schedules the specified task for execution at the specified time. If the time is in the past, the task is scheduled for immediate execution.
tasktask to be scheduled.
timetime at which task is to be executed.
scheduleAtFixedRate( Runnable task, java.util.Date firstTime, long period ) returns void
Schedules the specified task for repeated fixed-rate execution, beginning at the specified time. Subsequent executions take place at regular intervals, separated by the specified period.
taskTask to be scheduled.
firstTimeFirst time at which task is to be executed.
periodTime in milliseconds between successive task executions.
scheduleAtFixedRate( Runnable task, long delay, long period ) returns void
Schedules the specified task for repeated fixed-rate execution, beginning at the specified time. Subsequent executions take place at regular intervals, separated by the specified period.
taskTask to be scheduled.
delaydelay in milliseconds before task is to be executed.
periodTime in milliseconds between successive task executions.
cancel( ) returns void
initialized( ) returns boolean