org.springframework.scheduling.config

## Class IntervalTask

- java.lang.Object
- - org.springframework.scheduling.config.Task
  - - org.springframework.scheduling.config.IntervalTask

    public class IntervalTask
    extends Task

`Task` implementation defining a `Runnable` to be executed at a given millisecond interval which may be treated as fixed-rate or fixed-delay depending on context.

Since:
  3.2
Author:
  Chris Beams
See Also:
  `Scheduled.fixedRate()`, `Scheduled.fixedDelay()`, `ScheduledTaskRegistrar.setFixedRateTasksList(java.util.List)`, `ScheduledTaskRegistrar.setFixedDelayTasksList(java.util.List)`, `TaskScheduler`

### Constructor Summary

Constructors
Constructor and Description
`IntervalTask(Runnable runnable, long interval)` Create a new `IntervalTask` with no initial delay.
`IntervalTask(Runnable runnable, long interval, long initialDelay)` Create a new `IntervalTask`.

### Method Summary

Methods
`long` `getInitialDelay()`
`long` `getInterval()`

### Methods inherited from class org.springframework.scheduling.config.Task

`getRunnable`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IntervalTask

    public IntervalTask(Runnable runnable,
                long interval,
                long initialDelay)

Create a new `IntervalTask`.

Parameters:
  `runnable` - the underlying task to execute
  `interval` - how often in milliseconds the task should be executed
  `initialDelay` - initial delay before first execution of the task

#### IntervalTask

    public IntervalTask(Runnable runnable,
                long interval)

Create a new `IntervalTask` with no initial delay.

Parameters:
  `runnable` - the underlying task to execute
  `interval` - how often in milliseconds the task should be executed

### Method Detail

#### getInterval

    public long getInterval()

#### getInitialDelay

    public long getInitialDelay()