class Leafy::Core::Clock

Constants

DEFAULT

Public Class Methods

default_clock() click to toggle source

The default clock to use.

@return the default {@link Clock} instance

# File lib/leafy/core/clock.rb, line 22
def self.default_clock
  DEFAULT
end

Public Instance Methods

tick() click to toggle source

Returns the current time tick.

@return time tick in nanoseconds

# File lib/leafy/core/clock.rb, line 8
def tick
  (Time.now.to_f * 1000000000).to_i
end
time() click to toggle source

Returns the current time in milliseconds.

@return time in milliseconds

# File lib/leafy/core/clock.rb, line 15
def time
  (Time.now.to_f * 1000000).to_i
end