class Athena::Clock
- Athena::Clock
- Reference
- Object
Overview
Decouples applications from the system clock.
Included Modules
Defined in:
athena-clock.craware.cr
Constant Summary
-
VERSION =
"0.1.2"
Constructors
Class Method Summary
-
.clock : ACLK::Interface
Represents the global clock used by all
Athena::Clock
instances. -
.clock=(clock : ACLK::Interface)
Represents the global clock used by all
Athena::Clock
instances.
Instance Method Summary
-
#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.
-
#sleep(seconds : Number) : Nil
Sleeps for the provided amount of seconds.
Instance methods inherited from module Athena::Clock::Interface
in_location(location : Time::Location) : self
in_location,
now : Time
now,
sleep(span : Time::Span) : Nilsleep(seconds : Number) : Nil sleep
Constructor Detail
Class Method Detail
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.
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.
Instance Method Detail
Returns a new clock instance set to the provided location.