Skip to content

Instantly share code, notes, and snippets.

@hc2p
Last active September 7, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hc2p/8effa59432a5580a4cf53398165f3936 to your computer and use it in GitHub Desktop.
Save hc2p/8effa59432a5580a4cf53398165f3936 to your computer and use it in GitHub Desktop.
require 'rack-mini-profiler'
require 'flamegraph'
require 'stackprof'
def a
puts "method a started!"
sleep 0.5
puts "method a ended!"
end
def b
puts "method b started!"
sleep 0.5
d
sleep 0.5
puts "method b ended!"
end
def c
puts "method c started!"
sleep 0.5
puts "method c ended!"
end
def d
puts "method d started!"
sleep 0.5
e
sleep 0.5
e
sleep 0.5
puts "method d ended!"
end
def e
puts "method e started!"
sleep 0.5
puts "method e ended!"
end
Flamegraph.generate("flamegraph.test.html") do
a
b
c
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment