# `LibTmux.Deadline`
[🔗](https://github.com/libtmux/libtmux-elixir/blob/b72452c198917433229bdc266a68c163541b6127/lib/libtmux/deadline.ex#L1)

A node-local monotonic deadline shared by every stage of an operation.

Construct it once at admission. Passing it between stages preserves the
original budget; it is not a portable timestamp or a wire value.

# `option`

```elixir
@type option() :: {:now, integer()}
```

An optional node-local monotonic clock sample in milliseconds, used instead of sampling the current clock.

# `t`

```elixir
@opaque t()
```

A node-local monotonic millisecond cutoff. Share it between stages; never serialize it as a portable deadline.

# `new`

```elixir
@spec new(pos_integer(), [option()]) :: t()
```

Creates a deadline from a positive millisecond budget.

# `remaining`

```elixir
@spec remaining(t(), [option()]) :: non_neg_integer()
```

Returns the remaining milliseconds, clamped to zero after expiry.

---

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