Permalink
Browse files

check if RubyProf's WALL_TIME and PROCESS_TIME are available before u…

…sing them (similarly to other constants)
  • Loading branch information...
1 parent 9887f23 commit 23be2c613490a06170ae50a72889957b006d36a7 @goncalossilva goncalossilva committed Mar 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/testing/performance.rb
@@ -305,15 +305,15 @@ def format(measurement)
end
class ProcessTime < Time
- Mode = RubyProf::PROCESS_TIME
+ Mode = RubyProf::PROCESS_TIME if RubyProf.const_defined?(:PROCESS_TIME)
def measure
RubyProf.measure_process_time
end
end
class WallTime < Time
- Mode = RubyProf::WALL_TIME
+ Mode = RubyProf::WALL_TIME if RubyProf.const_defined?(:WALL_TIME)
def measure
RubyProf.measure_wall_time

0 comments on commit 23be2c6

Please sign in to comment.