method
duration
v8.0.0 -
Show latest stable
- Class:
ActiveSupport::Notifications::Event
duration()public
Returns the difference in milliseconds between when the execution of the event started and when it ended.
ActiveSupport::Notifications.subscribe('wait') do |event| @event = event end ActiveSupport::Notifications.instrument('wait') do sleep 1 end @event.duration # => 1000.138