---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://divkit.tech/docs/en/concepts/divs/2/div-timer.md
  - https://divkit.tech/docs/ru/concepts/divs/2/div-timer.md
---
> **Documentation Index:** Fetch the complete configuration index at https://divkit.tech/docs/en/llms.txt

# div-timer
Timer.

## Parameters
| Parameters | Description |
| --- | --- |
| `id` | <p>**string**</p><p>Required parameter.</p><p>Timer ID. Must be unique. Used when calling actions for the selected timer, for example: start, stop.</p> |
| `duration` | <p>**int**</p><p>Timer duration in milliseconds. If the parameter is `0` or not specified, the timer runs indefinitely (until the timer stop event occurs).</p><p>Restriction for the value `x`: `x >= 0`.</p><p>Default value: `0`.</p> |
| `end_actions` | <p>**array**</p><p>Actions performed when the timer ends: when the timer has counted to the `duration` value or the `div-action://timer?action=stop&id=<id>` command has been received.</p> |
| `tick_actions` | <p>**array**</p><p>Actions that are performed on each count of the timer.</p> |
| `tick_interval` | <p>**int**</p><p>Duration of time intervals in milliseconds between counts. If the parameter is not specified, the timer counts down from `0` to `duration` without calling `tick_actions`.</p><p>Restriction for the value `x`: `x > 0`.</p> |
| `value_variable` | <p>**string**</p><p>Name of the variable where the current timer value is stored. Updated on each count or when the timer commands are called (start, stop, and so on), except the cancel command.</p> |

<details>
<summary>JSON</summary>

```json
{
  duration: "int",
  end_actions: [
    {
      download_callbacks: {
        on_fail_actions: [ div-action, ... ],
        on_success_actions: [ div-action, ... ]
      },
      is_enabled: "bool_int",
      log_id*: "string",
      log_url: "string",
      menu_items: [
        {
          action: div-action,
          actions: [ div-action, ... ],
          text*: "string"
        },
        ...
      ],
      payload: "object",
      referer: "string",
      scope_id: "string",
      target: "string",
      typed: div-action-typed,
      url: "string"
    },
    ...
  ],
  id*: "string",
  tick_actions: [
    {
      download_callbacks: {
        on_fail_actions: [ div-action, ... ],
        on_success_actions: [ div-action, ... ]
      },
      is_enabled: "bool_int",
      log_id*: "string",
      log_url: "string",
      menu_items: [
        {
          action: div-action,
          actions: [ div-action, ... ],
          text*: "string"
        },
        ...
      ],
      payload: "object",
      referer: "string",
      scope_id: "string",
      target: "string",
      typed: div-action-typed,
      url: "string"
    },
    ...
  ],
  tick_interval: "int",
  value_variable: "string"
}
```
</details>
