ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)

Creates and background executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period. Executions will commence after initialDelay then initialDelay + period, then initialDelay + 2 * period, and so on. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the addin. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.

Parameters

Name Description
command The task to execute.
initialDelay The time to delay first execution.
period The period between successive executions.
unit The time unit of the initialDelay and period parameters.

Return

A ScheduledFuture representing pending completion of the task, and whose get() method will return throw an exception upon cancellation.