Discuss / Python / 交作业

交作业

Topic source

https://www.tuicool.com/articles/FBZvya

def metric(function):
    def callFunc(*arg, **argz):
        startTime = time.time_ns()
        temp = function(*arg, **argz)
        stopTime = time.time_ns()
        print('delay%.3fms' % ((stopTime - startTime) / 1e6 ))
        return temp
    return callFunc

  • 1

Reply