class Athena::Clock::Monotonic

Overview

The monotonic clock is primarily intended to be use to measure time, such as for a stopwatch. It's measurements are unaffected by inconsistencies sometimes introduced by the system clock. See Measuring Time for more information.

Included Modules

Defined in:

monotonic.cr

Constructors

Instance Method Summary

Instance methods inherited from module Athena::Clock::Interface

in_location(location : Time::Location) : self in_location, now : Time now, sleep(span : Time::Span) : Nil
sleep(seconds : Number) : Nil
sleep

Constructor Detail

def self.new(location : Time::Location | Nil = nil) #

[View source]

Instance Method Detail

def in_location(location : Time::Location) : self #

Returns a new clock instance set to the provided location.


[View source]
def now : Time #

Returns the current time as determined by the clock.


[View source]
def sleep(span : Time::Span) : Nil #

Sleeps for the provided span of time.


[View source]
def sleep(seconds : Number) : Nil #

Sleeps for the provided amount of seconds.


[View source]