class Athena::Clock
inherits Reference
#
Decouples applications from the system clock.
Included modules
Athena::Clock::Interface
Constants#
VERSION = "0.1.2"
#
Constructors#
.new(clock : ACLK::Interface | Nil = nil, location : Time::Location | Nil = nil)
#
Class methods#
.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.
.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.
Methods#
#in_location(location : Time::Location) : self
#
Returns a new clock instance set to the provided location.
#now : Time
#
Returns the current time as determined by the clock.
#sleep(span : Time::Span) : Nil
#
Sleeps for the provided span of time.