BuildkiteTestCollector.Duration (buildkite_test_collector v0.3.1)

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.

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.

Types

t()

@type t() :: %BuildkiteTestCollector.Duration{usec: integer()}

Functions

abs(duration)

@spec abs(t()) :: t()

Return the absolute duration (ie make the duration unsigned).

as_seconds(duration)

@spec as_seconds(t()) :: number()

The duration of the timing, in (fractional) seconds.

between(instant1, instant2)

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)

@spec from_microseconds(number()) :: t()

Create a new duration directly from microseconds.

from_seconds(seconds)

@spec from_seconds(number()) :: t()

Create a new duration from the specified number of seconds.