Util.Duration (fnord v0.8.82)

View Source

Human-friendly duration formatting utilities.

Modes:

  • :natural (default): "H hours, M minutes, S seconds" with proper pluralization.
  • :compact : "H:MM:SS" / "M:SS" / "Ss" (reserved for future use).

Summary

Types

mode()

@type mode() :: :natural | :compact

Functions

format(seconds, mode \\ :natural)

@spec format(non_neg_integer(), mode()) :: String.t()