Flowdock
method

duration

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - 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 |*args|
  @event = ActiveSupport::Notifications::Event.new(*args)
end

ActiveSupport::Notifications.instrument('wait') do
  sleep 1
end

@event.duration # => 1000.138
Show source
Register or log in to add new notes.