class

Athena::Clock

Inherits Athena::Clock::Interface < Reference < Object

Decouples applications from the system clock.

Constants

VERSION = "0.3.0"

Constructors

new(clock : ACLK::Interface | Nil = nil, location : Time::Location | Nil = nil)
Source

Class methods

clock

Represents the global clock used by all Athena::Clock instances.

NOTE: It is preferable injecting an Athena::Clock::Interface when possible versus using the global clock getter.

Source
clock=(clock : ACLK::Interface)

Represents the global clock used by all Athena::Clock instances.

NOTE: It is preferable injecting an Athena::Clock::Interface when possible versus using the global clock getter.

Source

Instance methods

in_location(location : Time::Location) : self

Returns a new clock instance set to the provided location.

Source
now

Returns the current time as determined by the clock.

Source
sleep(span : Time::Span) : Nil

Sleeps for the provided span of time.

Source

Nested types