Skip to content

Instantly share code, notes, and snippets.

@shotgundebugging
Forked from tenderlove/sample_profiler.rb
Created July 31, 2024 14:21
Show Gist options
  • Save shotgundebugging/9ca9fee8862d48708147904a8a8199cb to your computer and use it in GitHub Desktop.
Save shotgundebugging/9ca9fee8862d48708147904a8a8199cb to your computer and use it in GitHub Desktop.
profiler = Thread.new do
while true
p Thread.main.backtrace
sleep 0.5
end
end
def slow_function
sleep 2
end
def calls_slow
sleep 1
slow_function
sleep 7
end
sleep 2
calls_slow
sleep 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment