Package org.springframework.scheduling.config

# Class DelayedTask

java.lang.Object
org.springframework.scheduling.config.Task
org.springframework.scheduling.config.DelayedTask

Direct Known Subclasses:
  `IntervalTask`, `OneTimeTask`

public class DelayedTask extends Task
`Task` implementation defining a `Runnable` with an initial delay.

Since:
  6.1
Author:
  Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`DelayedTask(Runnable runnable, Duration initialDelay)`
Create a new `DelayedTask`.

## Method Summary

Modifier and Type
Method
Description
`Duration`
`getInitialDelayDuration()`
Return the initial delay before first execution of the task.

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

`getLastExecutionOutcome, getRunnable, toString`

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

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

## Constructor Details

### DelayedTask

public DelayedTask(Runnable runnable, Duration initialDelay)
Create a new `DelayedTask`.

Parameters:
  `runnable` - the underlying task to execute
  `initialDelay` - the initial delay before execution of the task

## Method Details

### getInitialDelayDuration

public Duration getInitialDelayDuration()
Return the initial delay before first execution of the task.