##// END OF EJS Templates
Added the plural variable with another string formating
Pablo Galindo -
Show More
@@ -91,14 +91,8 b' class TimeitResult(object):'
91 return (math.fsum([(x - mean) ** 2 for x in self.timings]) / len(self.timings)) ** 0.5
91 return (math.fsum([(x - mean) ** 2 for x in self.timings]) / len(self.timings)) ** 0.5
92
92
93 def __str__(self):
93 def __str__(self):
94 if self.loops == 1: # No s at "loops" if only one loop
94 return (u"%s loop%s, average of %d: %s +- %s per loop (using standard deviation)"
95 return (u"%s loop, average of %d: %s +- %s per loop (using standard deviation)"
95 % (self.loops,"" if self.loops == 1 else "s", self.repeat,
96 % (self.loops, self.repeat,
97 _format_time(self.average, self._precision),
98 _format_time(self.stdev, self._precision)))
99 else:
100 return (u"%s loops, average of %d: %s +- %s per loop (using standard deviation)"
101 % (self.loops, self.repeat,
102 _format_time(self.average, self._precision),
96 _format_time(self.average, self._precision),
103 _format_time(self.stdev, self._precision)))
97 _format_time(self.stdev, self._precision)))
104
98
General Comments 0
You need to be logged in to leave comments. Login now