For CPU time usage, see the standard time module <http://docs.python.org/lib/module-time.html> specifically the time.clock() function. For memory usage see <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286222> /Jean Brouwers