为了账号安全,请及时绑定邮箱和手机立即绑定

@performance 怎么算时间才是对的

@performance 怎么算时间才是对的

oxygen172 2016-02-16 19:57:21
performance(f):     fn(*args, **kw):         start_time = time.time()         r = f(*args, **kw)         end_time = time.time()         %(f., (end_time - start_time))         %(f., (time.time() - start_time))         r     fn @factorial(n):     (x, y: x * y, (, n+)) factorial() 上面有两个打印消耗时间的,只是其中一个来对比,时间不一样,不知道怎么才算是真正算performance的时间
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1445 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信