NebulaGraphEx.Types.Duration (nebula_graph_ex v0.1.10)

Copy Markdown View Source

NebulaGraph duration value.

Durations are stored as a combination of months, seconds, and microseconds because months cannot be represented as a fixed number of seconds (they vary in length).

Fields

  • :months — total months component
  • :seconds — seconds component (independent of months)
  • :microseconds — sub-second component

Summary

Functions

Returns the total number of seconds in the non-month component. Does not account for the :months field (months are calendar-dependent).

Types

t()

@type t() :: %NebulaGraphEx.Types.Duration{
  microseconds: integer(),
  months: integer(),
  seconds: integer()
}

Functions

total_seconds(duration)

@spec total_seconds(t()) :: float()

Returns the total number of seconds in the non-month component. Does not account for the :months field (months are calendar-dependent).