class Spectator::SystemClock
A timing source that can be used to access the current time as an object, and a high resolution monotonic time
Public Instance Methods
monotonic_time()
click to toggle source
A monotonically increasing number of nanoseconds. This is useful for recording times, or benchmarking. Note that this is not guaranteed to be steady. In other words each tick of the underlying clock may not be the same length (e.g. some seconds might be longer than others) @return A monotonic number of nanoseconds
# File lib/spectator/clock.rb, line 11 def monotonic_time MonotonicTime.time_in_nanoseconds end
wall_time()
click to toggle source
@return a time object for the current time
# File lib/spectator/clock.rb, line 16 def wall_time Time.now end