Last active
August 29, 2015 14:05
-
-
Save minad/5a041839cc5aa76c1522 to your computer and use it in GitHub Desktop.
ruby profile block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def profile(&b) | |
require 'ruby-prof' | |
printer = RubyProf::FlatPrinter.new(RubyProf.profile(&b)) | |
File.open('/tmp/profile.txt', 'w') {|f| printer.print(f) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment