Newer
Older
TB_Chris / TbUT / options / python / .svn / text-base / Timer.py.svn-base
@iaro iaro on 9 May 2016 326 bytes first attempt of automated anal
  1. __author__ = 'ja'
  2.  
  3. import time
  4.  
  5. def timer(method):
  6.  
  7. def timed(*args, **kw):
  8. startTime = time.time()
  9. result = method(*args, **kw)
  10. endTime = time.time()
  11.  
  12. print ('execution of %r takes %2.2f sec') % \
  13. (method.__name__, endTime-startTime)
  14. return result
  15.  
  16. return timed