Forum: Ruby Monitoring time spent running classes and methods

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
97334b75c93574ed3e514f33849f0953?d=identicon&s=25 Mario Ruiz (tcblues)
on 2009-02-24 11:53
I would like to know if there is any way to know how much time my
classes and methods are running. I would like to improve it running the
test cases faster so  I need to know which ones should be the first to
improve.

So... my question is... how can I know the running time for every single
method and class? I mean without including in every method a log at the
beginning and end since I have hundreds of them.

Thanks in advance.
D1f1c20467562fc1d8c8aa0d328def62?d=identicon&s=25 Florian Gilcher (skade)
on 2009-02-24 12:45
(Received via mailing list)
On Feb 24, 2009, at 11:53 AM, Mario Ruiz wrote:

> beginning and end since I have hundreds of them.
>
> Thanks in advance.
> --
> Posted via http://www.ruby-forum.com/.
>

I would say: thats highly dependant on the operating system you use.
For example,
on OS X and Solaris, I would suggest to use dtrace for such a task.

Regards,
Florian

--
Florian Gilcher

smtp:   flo@andersground.net
jabber: Skade@jabber.ccc.de
gpg:    533148E2
97334b75c93574ed3e514f33849f0953?d=identicon&s=25 Mario Ruiz (tcblues)
on 2009-02-24 12:48
I'm working on Vista


Florian Gilcher wrote:
> On Feb 24, 2009, at 11:53 AM, Mario Ruiz wrote:
>
F52a217f68b0d4db49ce2ceb06f79691?d=identicon&s=25 Alex Fenton (Guest)
on 2009-02-24 12:55
(Received via mailing list)
Mario Ruiz wrote:

> So... my question is... how can I know the running time for every single
> method and class?

Run the script you're interested in tracing with -rprofile

ruby -rprofile how_long_does_this_stuff_take.rb

a
97334b75c93574ed3e514f33849f0953?d=identicon&s=25 Mario Ruiz (tcblues)
on 2009-02-24 13:58
Thanks a lot
Is there any Eclipse plug-in that can do the same?
This topic is locked and can not be replied to.