##// END OF EJS Templates
Better and more explicit warning message
MechCoder -
Show More
@@ -1025,9 +1025,12 b' python-profiler package from non-free.""")'
1025 worst = max(all_runs) / number
1025 worst = max(all_runs) / number
1026 if worst_tuning:
1026 if worst_tuning:
1027 worst = max(worst, worst_tuning)
1027 worst = max(worst, worst_tuning)
1028 if worst > 4 * best and best:
1028 # Check best timing is greater than zero to avoid a
1029 warn("Worst time is %0.2f times that of the best. Timings may "
1029 # ZeroDivisionError.
1030 "be biased." % (worst / best))
1030 if worst > 4 * best and best > 0:
1031 print("The slowest run took %0.2f times longer than the "
1032 "fastest. This could mean that an intermediate result "
1033 "is being cached " % (worst / best))
1031 print(u"%d loops, best of %d: %s per loop" % (number, repeat,
1034 print(u"%d loops, best of %d: %s per loop" % (number, repeat,
1032 _format_time(best, precision)))
1035 _format_time(best, precision)))
1033 if tc > tc_min:
1036 if tc > tc_min:
General Comments 0
You need to be logged in to leave comments. Login now