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



10
11
12
# File 'lib/bunny/timestamp.rb', line 10

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

.non_monotonicObject



14
15
16
# File 'lib/bunny/timestamp.rb', line 14

def self.non_monotonic
  ::Time.now
end

.non_monotonic_utcObject



18
19
20
# File 'lib/bunny/timestamp.rb', line 18

def self.non_monotonic_utc
  self.non_monotonic.utc
end

.nowObject



6
7
8
# File 'lib/bunny/timestamp.rb', line 6

def self.now
  ::Time.now
end