提交 f0fac6fb authored 作者: Frederic's avatar Frederic

print the sum of all profile only when more then 1 was printed.

上级 e8f61bf9
......@@ -38,12 +38,14 @@ AddConfigVar('profiling.time_thunks',
def _atexit_print_fn():
"""Print ProfileStat objects in _atexit_print_list to _atexit_print_file
"""
printed = 0
for ps in _atexit_print_list:
if ps.fct_callcount or ps.compile_time > 0:
ps.summary(file=_atexit_print_file)
printed += 1
else:
print 'Skipping empty Profile'
if len(_atexit_print_list) > 1:
if printed > 1:
# Make a global profile
cum = copy.copy(_atexit_print_list[0])
cum.message = "Sum of all printed profiles at exit"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论