I've added another method descriptor, @Timed, to easyprof.py. It basically just prints the absolute time spent calling a method... an easy way to consistently measure a particular routine

to use:

from util.easyprof import Timed

class Foo(...):
    @Timed
    def MySlowMethod(self, ...):
        ....


That's it. Just adding @Timed in front of any method will make it print out:

Call to wxSynchronizeWidget = 0.021
Call to wxSynchronizeWidget = 0.006
Call to wxSynchronizeWidget = 0.002
Call to wxSynchronizeWidget = 0.002
Call to wxSynchronizeWidget = 0.006
Call to wxSynchronizeWidget = 0.002
Call to wxSynchronizeWidget = 0.009
Call to wxSynchronizeWidget = 0.005
Call to wxSynchronizeWidget = 0.009

Enjoy.

Alec
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to