class Spectator::ManualClock

A timing source useful in unit tests that can be used to mock the methods in SystemClock

Attributes

monotonic_time[RW]
wall_time[RW]

Public Class Methods

new(wall_init: Time.utc(2000, 'jan', 1, 0, 0, 0), mono_time: 0) click to toggle source

Get a new object using 2000-1-1 0:0:0 UTC as the default time, and 0 nanoseconds as the number of nanos reported by monotonic_time

# File lib/spectator/clock.rb, line 31
def initialize(wall_init: Time.utc(2000, 'jan', 1, 0, 0, 0), mono_time: 0)
  @wall_time = wall_init
  @monotonic_time = mono_time
end