Class: Dry::Monitor::Clock
- Inherits:
-
Object
- Object
- Dry::Monitor::Clock
- Defined in:
- lib/dry/monitor/notifications.rb
Instance Method Summary collapse
Instance Method Details
#current ⇒ Object
15 16 17 |
# File 'lib/dry/monitor/notifications.rb', line 15 def current Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) end |
#measure ⇒ Object
9 10 11 12 13 |
# File 'lib/dry/monitor/notifications.rb', line 9 def measure start = current result = yield [result, current - start] end |