Module: Statue::Clock
Instance Method Summary collapse
Instance Method Details
#duration_in_ms ⇒ Object
9 10 11 12 13 |
# File 'lib/statue/clock.rb', line 9 def duration_in_ms start = now_in_ms yield now_in_ms - start end |
#now_in_ms ⇒ Object
5 6 7 |
# File 'lib/statue/clock.rb', line 5 def now_in_ms Process.clock_gettime(Process::CLOCK_MONOTONIC) * 1_000 end |