提交 9231d8ee authored 作者: Frederic Bastien's avatar Frederic Bastien

better fix for div per zero.

上级 a2ec1b1e
......@@ -188,10 +188,8 @@ class ProfileMode(Mode):
tot+=t
ftot=tot*100/local_time
if nb_call==0:
time_per_call = float('nan')
else:
time_per_call = t/nb_call
print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %i %i %s' % (f, ftot, t, tot, time_per_call,nb_call, a[0], str(a[1]))
continue
print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %i %i %s' % (f, ftot, t, tot, t/nb_call,nb_call, a[0], str(a[1]))
print ' ... (remaining %i Apply instances account for %.2f%%(%.2fs) of the runtime)'\
%(max(0, len(atimes)-n_apply_to_print),
sum(f for f, t, a, nb_call in atimes[n_apply_to_print:]),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论