Skip to content

Instantly share code, notes, and snippets.

@andhapp
Forked from tenderlove/tracepoint.rb
Created December 8, 2013 23:23
Show Gist options
  • Save andhapp/7865091 to your computer and use it in GitHub Desktop.
Save andhapp/7865091 to your computer and use it in GitHub Desktop.
class Foo
def self.foo; end
def foo; end
end
tp = TracePoint.new("call") do |trace|
p [trace.defined_class, trace.method_id, trace.event, trace.lineno]
end
tp.enable
10.times { Foo.foo }
foo = Foo.new
10.times { foo.foo }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment