chaperon v0.1.0 Chaperon.Timing View Source

Timing related helper functions and type definitions used within Chaperon.

Link to this section Summary

Functions

Returns the correct amount of milliseconds for a given amount of days

Returns the correct amount of milliseconds for a given amount of hours

Returns the correct amount of milliseconds for a given amount of minutes

Returns the correct amount of milliseconds for a given amount of seconds

Returns a timestamp with the given time unit

Returns the correct amount of milliseconds for a given amount of weeks

Link to this section Types

Link to this type duration_number() View Source
duration_number() :: non_neg_integer | float | Range.t
Link to this type time_unit() View Source
time_unit ::
  :seconds |
  :milli_seconds |
  :micro_seconds |
  :nano_seconds

Link to this section Functions

Link to this function days(num) View Source
days(duration) :: non_neg_integer

Returns the correct amount of milliseconds for a given amount of days.

Link to this function hours(num) View Source
hours(duration) :: non_neg_integer

Returns the correct amount of milliseconds for a given amount of hours.

Link to this function minutes(num) View Source
minutes(duration) :: non_neg_integer

Returns the correct amount of milliseconds for a given amount of minutes.

Link to this function seconds(num) View Source
seconds(duration) :: non_neg_integer

Returns the correct amount of milliseconds for a given amount of seconds.

Link to this function timestamp(unit \\ :milli_seconds) View Source
timestamp(time_unit) :: non_neg_integer

Returns a timestamp with the given time unit.

Link to this function weeks(num) View Source
weeks(duration) :: non_neg_integer

Returns the correct amount of milliseconds for a given amount of weeks.