Nebulex.Time (Nebulex v2.0.0) View Source
Time utilities.
Link to this section Summary
Functions
Returns the current system time in the given time unit.
Returns true
if the given timeout
is a valid timeout; otherwise, false
is returned.
Link to this section Functions
Specs
now(System.time_unit()) :: integer()
Returns the current system time in the given time unit.
The unit
is set to :millisecond
by default.
Examples
iex> Nebulex.Time.now()
_milliseconds
Specs
Returns true
if the given timeout
is a valid timeout; otherwise, false
is returned.
Valid timeout: :infinity | non_neg_integer()
.
Examples
iex> Nebulex.Time.timeout?(1)
true
iex> Nebulex.Time.timeout?(:infinity)
true
iex> Nebulex.Time.timeout?(-1)
false