BuildkiteTestCollector.Duration (buildkite_test_collector v0.2.0)
The difference between two instants with microsecond accuracy.
The Buildkite analytics API stores all times as decimal seconds since the
start of the test run. Therefore we use Duration to calculate the span
between two Instant values.
Link to this section Summary
Functions
Return the absolute duration (ie make the duration unsigned).
The duration of the timing, in (fractional) seconds.
Return the elapsed time between two instants.
Returns the elapsed duration between instant and now.
Create a new duration directly from microseconds.
Create a new duration from the specified number of seconds.
Link to this section Types
@type t() :: %BuildkiteTestCollector.Duration{usec: integer()}
Link to this section Functions
abs(duration)
Return the absolute duration (ie make the duration unsigned).
as_seconds(duration)
The duration of the timing, in (fractional) seconds.
between(instant1, instant2)
@spec between(BuildkiteTestCollector.Instant.t(), BuildkiteTestCollector.Instant.t()) :: t()
Return the elapsed time between two instants.
elapsed(instant)
@spec elapsed(BuildkiteTestCollector.Instant.t()) :: t()
Returns the elapsed duration between instant and now.
from_microseconds(microseconds)
Create a new duration directly from microseconds.
from_seconds(seconds)
Create a new duration from the specified number of seconds.