lib/commands/profile.rb in pry-moves-1.0.12 vs lib/commands/profile.rb in pry-moves-1.0.13

- old
+ new

@@ -1,12 +1,19 @@ class PryMoves::Profile < PryMoves::TraceCommand def init(binding_) @start_line = binding_.eval('__LINE__') + @profiling_start_at = Time.now + @timeout = (@command[:param]&.to_i || 3).seconds end def trace(event, file, line, method, binding_) return unless file.start_with? PryMoves.project_root + + if Time.now - @profiling_start_at > @timeout + PryMoves.messages << "Profiling timeout: #{@timeout} seconds" + return true + end stop = false place = "#{method} @ #{file}:#{line}" if @last_place != place if @last_start_at