> **Experimental**
>
> `@aws-cdk/aws-iotevents-actions-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# TimerDuration

The duration of the timer.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/timer-duration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-iotevents-actions-alpha/lib/timer-duration.ts#L7)

## Example

```ts
import * as iotevents from '@aws-cdk/aws-iotevents-alpha';
import * as actions from '@aws-cdk/aws-iotevents-actions-alpha';

declare const input: iotevents.IInput;

const state = new iotevents.State({
  stateName: 'MyState',
  onEnter: [{
    eventName: 'test-event',
    condition: iotevents.Expression.currentInput(input),
    actions: [
      new actions.SetTimerAction('MyTimer', {
        duration: cdk.Duration.seconds(60),
      }),
    ],
  }],
});
```

## Initializer

```ts
new TimerDuration()
```

## Methods

- `fromDuration(duration: Duration): TimerDuration // chainable` (static) — Create a timer-duration from Duration.

  The range of the duration is 60-31622400 seconds.
  The evaluated result of the duration expression is rounded down to the nearest whole number.
  For example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.

- `fromExpression(expression: Expression): TimerDuration // chainable` (static) — Create a timer-duration from Expression.

  You can use a string expression that includes numbers, variables ($variable.<variable-name>),
  and input values ($input.<input-name>.<path-to-datum>) as the duration.

  The range of the duration is 60-31622400 seconds.
  The evaluated result of the duration expression is rounded down to the nearest whole number.
  For example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.
