mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
check if RubyProf's WALL_TIME and PROCESS_TIME are available before using them (similarly to other constants)
This commit is contained in:
@@ -305,7 +305,7 @@ begin
|
||||
end
|
||||
|
||||
class ProcessTime < Time
|
||||
Mode = RubyProf::PROCESS_TIME
|
||||
Mode = RubyProf::PROCESS_TIME if RubyProf.const_defined?(:PROCESS_TIME)
|
||||
|
||||
def measure
|
||||
RubyProf.measure_process_time
|
||||
@@ -313,7 +313,7 @@ begin
|
||||
end
|
||||
|
||||
class WallTime < Time
|
||||
Mode = RubyProf::WALL_TIME
|
||||
Mode = RubyProf::WALL_TIME if RubyProf.const_defined?(:WALL_TIME)
|
||||
|
||||
def measure
|
||||
RubyProf.measure_wall_time
|
||||
|
||||
Reference in New Issue
Block a user