class Quartz::TimeCache

Overview

The TimeCache data structure is used to store and retrieve elapsed durations since a particular event.

Defined in:

quartz/time_cache.cr

Constructors

Instance Method Summary

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(current_time : TimePoint = TimePoint.new(0)) #

[View source]

Instance Method Detail

def advance(by duration : Duration) : TimePoint #

Advance the current time by the given Duration relative to the current time.


[View source]
def advance(until time_point : TimePoint) : TimePoint #

Advance the current time until match the given TimePoint.


[View source]
def current_time : TimePoint #

Returns the current time associated with the time cache.


[View source]
def current_time=(current_time : TimePoint) #

Returns the current time associated with the time cache.


[View source]
def elapsed_duration_of(event : Schedulable) : Duration #

Returns the elapsed Duration associated with the given event since the previous event.


[View source]
def release_event(event : Schedulable) #

Cancel the tracking of the elapsed duration since the previous event of the given event.


[View source]
def retain_event(event : Schedulable, precision : Scale) #

Retain the given event in order to track the elapsed duration since the #current_time as time advances.


[View source]
def retain_event(event : Schedulable, elapsed : Duration) #

Retain the given event with a given elapsed duration since the #current_time, in order to track it as time advances.


[View source]