Discuss / Python / 郭丁玮郭丁玮

郭丁玮郭丁玮

Topic source

def metric(fn):

    def test(*x):

        start=time.time()

        num=fn(*x)

        end=time.time()

        print('%s executed in %.4f ms' % (fn.__name__, end-start))

        return num

    return test


  • 1

Reply