Roger Pack wrote in post #1114319:
> On 6/24/13, Andras Horvath <lists / ruby-forum.com> wrote:
>> gem-ruby-1.9.3-p125-gcdata install ruby-prof
>>
>> require "ruby-prof"
>>
>> RubyProf.measure_mode = RubyProf::MEMORY
>> RubyProf.start
>>         # code to profile
>>         10000.times { "hello".chars.to_a.shuffle.join }
>> r = RubyProf.stop
>> RubyProf::FlatPrinter.new(r).print
>
> What doesn't work about it?

I get an output like below doing the above:

$ ruby-1.9.3-p125-gcdata test.rb
Thread ID: 15804340
Fiber ID: 15659960
Total: 0.000000
Sort by: self_time

 %self      total      self      wait     child     calls  name
   NaN      0.000     0.000     0.000     0.000    10000   Array#join
   NaN      0.000     0.000     0.000     0.000    10000   Array#shuffle
   NaN      0.000     0.000     0.000     0.000    10000 
Enumerator#each
   NaN      0.000     0.000     0.000     0.000    10000 
Enumerable#to_a
   NaN      0.000     0.000     0.000     0.000    20000   String#chars
   NaN      0.000     0.000     0.000     0.000        1   Integer#times
   NaN      0.000     0.000     0.000     0.000        1   Global#[No 
method]

* indicates recursively called methods

-- 
Posted via http://www.ruby-forum.com/.