Module Lifecycle.Duration

type t
type error =
  1. | Negative
  2. | Non_finite
val create : seconds:float -> (t, error) Stdlib.result

Rejects negative and non-finite durations; zero is valid.

exception Invalid_duration of error

Raised by create_exn with the typed reason for invalid input.

val create_exn : seconds:float -> t