##// END OF EJS Templates
Add comma groupings to timeit magic loop count
Andrew Port -
Show More
@@ -92,17 +92,15 b' class TimeitResult(object):'
92 pm = u'\xb1'
92 pm = u'\xb1'
93 except:
93 except:
94 pass
94 pass
95 return (
95 return "{mean} {pm} {std} per loop (mean {pm} std. dev. of {runs} run{run_plural}, {loops:,} loop{loop_plural} each)".format(
96 u"{mean} {pm} {std} per loop (mean {pm} std. dev. of {runs} run{run_plural}, {loops} loop{loop_plural} each)"
96 pm=pm,
97 .format(
97 runs=self.repeat,
98 pm = pm,
98 loops=self.loops,
99 runs = self.repeat,
99 loop_plural="" if self.loops == 1 else "s",
100 loops = self.loops,
100 run_plural="" if self.repeat == 1 else "s",
101 loop_plural = "" if self.loops == 1 else "s",
101 mean=_format_time(self.average, self._precision),
102 run_plural = "" if self.repeat == 1 else "s",
102 std=_format_time(self.stdev, self._precision),
103 mean = _format_time(self.average, self._precision),
103 )
104 std = _format_time(self.stdev, self._precision))
105 )
106
104
107 def _repr_pretty_(self, p , cycle):
105 def _repr_pretty_(self, p , cycle):
108 unic = self.__str__()
106 unic = self.__str__()
General Comments 0
You need to be logged in to leave comments. Login now