Newer
Older
Tb / TbUT / options / python / .svn / text-base / Timer.py.svn-base
__author__ = 'ja'

import time

def timer(method):

    def timed(*args, **kw):
        startTime = time.time()
        result = method(*args, **kw)
        endTime = time.time()

        print ('execution of %r  takes  %2.2f sec') % \
              (method.__name__, endTime-startTime)
        return result

    return timed