# `AshWorkflow.Duration`
[🔗](https://github.com/team-alembic/ash_workflow/blob/v0.12.0/lib/ash_workflow/duration.ex#L1)

The duration tuple a `timeout` measures with `fire_after` and a `retry` block
waits with `backoff`.

It exists so both read the same tuple: `{3, :days}`, `{10, :seconds}`.

# `t`

```elixir
@type t() :: {pos_integer(), unit()}
```

# `unit`

```elixir
@type unit() :: :seconds | :minutes | :hours | :days
```

# `to_milliseconds`

```elixir
@spec to_milliseconds(t()) :: pos_integer()
```

Converts a duration to milliseconds.

# `to_seconds`

```elixir
@spec to_seconds(t()) :: pos_integer()
```

Converts a duration to seconds.

# `validate`

```elixir
@spec validate(term()) :: {:ok, t()} | {:error, String.t()}
```

Validates a duration tuple, for use as a Spark `{:custom, ...}` schema type.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
