Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

duration is called multiple times in dev, so lets cache it

  • Loading branch information...
commit 48c8135423dd7a8ff676b858cad6795a15903826 1 parent d1b618b
@tenderlove tenderlove authored
View
3  activesupport/lib/active_support/notifications/instrumenter.rb
@@ -54,10 +54,11 @@ def initialize(name, start, ending, transaction_id, payload)
@transaction_id = transaction_id
@end = ending
@children = []
+ @duration = nil
end
def duration
- 1000.0 * (self.end - time)
+ @duration ||= 1000.0 * (self.end - time)
end
def <<(event)
Please sign in to comment.
Something went wrong with that request. Please try again.