Skip to content

Instantly share code, notes, and snippets.

@xarimanx
Last active December 18, 2015 00:29
Show Gist options
  • Save xarimanx/5697462 to your computer and use it in GitHub Desktop.
Save xarimanx/5697462 to your computer and use it in GitHub Desktop.
ruby-prof
require "ruby-prof"
around_filter :profile
def profile
return yield if params[:profile].nil?
result = RubyProf.profile { yield }
printer = RubyProf::FlatPrinter.new(result)
File.open("profile.txt", "w+") do |f|
printer.print(f, {})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment