From: David Garamond Date: 2005-01-23T03:35:23+09:00 Subject: Re: Profiling question Tripp Scott wrote: >>>$ ruby -rprofile ./profile1.rb >>> % cumulative self self total >>> time seconds seconds calls ms/call ms/call name >>>[snip] >>> 0.26 3.82 0.01 20 0.50 34.00 Object#f3 >>>[snip] >>> 0.00 3.82 0.00 1 0.00 1640.00 Object#f2 >>> 0.00 3.82 0.00 1 0.00 350.00 Object#f4 >>>[snip] >>> 0.00 3.82 0.00 1 0.00 1480.00 Object#f1 >> >>Are those what you're after? > > LOL. Actually yes. Now why did I miss that? :-) Btw, I notice that the times the profiler reports are slower/larger due to the profiling overhead. Suppose that the profiler reports total ms/call = X1. The real time from the "time" command when invoking the script without the profiler = X2 secs. Real time with the profiler = X3 secs. Can I assume that the actual time when running without profiler is X2/X3 * X1? $ time ruby script.rb real 0m0.148s user 0m0.020s sys 0m0.010s $ time ruby -rprofile script.rb % cumulative self self total time seconds seconds calls ms/call ms/call name ... 0.00 0.31 0.00 10 0.00 28.00 Object#f3 ... real 0m0.659s user 0m0.310s sys 0m0.060s $ irb irb(main):001:0> 0.148/0.659*28.00 => 6.28831562974203 irb(main):002:0> So f3 takes about 6.29ms when running normally (without profiler)? -- dave