Mercurial > pylearn
view common/mytime.py @ 365:a04ce1e6ea54
Bugfix in common.misc.find_files
author | Joseph Turian <turian@gmail.com> |
---|---|
date | Thu, 03 Jul 2008 18:48:32 -0400 |
parents | 9e84e8a20a75 |
children |
line wrap: on
line source
import time #http://www.daniweb.com/code/snippet368.html def print_timing(func): def wrapper(*arg): t1 = time.time() res = func(*arg) t2 = time.time() print '%s took %0.3f ms' % (func.func_name, (t2-t1)*1000.0) return res return wrapper