Module: Statue::Clock

Extended by:
Clock
Included in:
Clock
Defined in:
lib/statue/clock.rb

Instance Method Summary collapse

Instance Method Details

#duration_in_msObject



19
20
21
22
23
# File 'lib/statue/clock.rb', line 19

def duration_in_ms
  start = now_in_ms
  yield
  now_in_ms - start
end

#now_in_msObject



6
7
8
# File 'lib/statue/clock.rb', line 6

def now_in_ms
  Process.clock_gettime(Process::CLOCK_MONOTONIC) * 1_000
end