ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)

Creates and background executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. 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.

Parameters

Name Description
command The task to execute.
initialDelay The time to delay first execution.
delay The delay between the termination of one execution and the commencement of the next.
unit The time unit of the initialDelay and delay parameters.

Return

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