Class: Bunny::Timestamp

Inherits:
Object
  • Object
show all
Defined in:
lib/bunny/timestamp.rb

Overview

Abstracts away the Ruby (OS) method of retriving timestamps.

Class Method Summary collapse

Class Method Details

.monotonicObject



12
13
14
# File 'lib/bunny/timestamp.rb', line 12

def self.monotonic
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

.non_monotonicObject



16
17
18
# File 'lib/bunny/timestamp.rb', line 16

def self.non_monotonic
  ::Time.now
end

.non_monotonic_utcObject



20
21
22
# File 'lib/bunny/timestamp.rb', line 20

def self.non_monotonic_utc
  self.non_monotonic.utc
end

.nowObject



8
9
10
# File 'lib/bunny/timestamp.rb', line 8

def self.now
  ::Time.now
end