Discuss / Python / 交作业

交作业

Topic source

menfrexu

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

装饰器,基本就是照葫芦画瓢。

def metric(fn):
    def wrapper(*args, **kw):
        print('%s executed in %s ms' % (fn.__name__, int(time.time() * 1000)))
        return fn(*args, **kw)
    return wrapper

py 只有一种获取时间戳的方式吗,有直接获取13位毫秒的方式吗


  • 1

Reply