【python】map list for 运行时长测试
摘要:
import time,sysreps=1000size=10000def tester(func,*args): starttime=time.time() for i in range(reps): func(*args) spendtime=time.time()-starttime return spendtimedef forstst(): res=[] for x in range(size): res.append(abs(x))def liststst(): res=[abs(x) for x in rang... 阅读全文
posted @ 2013-09-03 16:42 colipso 阅读(651) 评论(0) 推荐(0) 编辑