# `LibTmux.Deadline`
[🔗](https://github.com/libtmux/libtmux-elixir/blob/86ad4ca80f157adb0c11f6bf7c371b04ca5aa688/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.

See the [worked example](api-examples.html#encoding-and-protocol).

# `remaining`

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

Returns the remaining milliseconds, clamped to zero after expiry.

See the [worked example](api-examples.html#encoding-and-protocol).

---

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