Discuss / Python / Decorator_metric

Decorator_metric

Topic source

不会潘岩

#1 Created at ... [Delete] [Delete and Lock User]

* coding:utf-8 *

import time ,functools def metric(fn): functools.wraps(fn) def wrapper(args,**kw): print('%s executed in %s ms' % (fn.name, 10.24)) return fn(args,**kw) return wrapper


  • 1

Reply