Show More
@@ -982,7 +982,7 python-profiler package from non-free.""") | |||||
982 | if number == 0: |
|
982 | if number == 0: | |
983 | # determine number so that 0.2 <= total time < 2.0 |
|
983 | # determine number so that 0.2 <= total time < 2.0 | |
984 | number = 1 |
|
984 | number = 1 | |
985 |
for |
|
985 | for _ in range(1, 10): | |
986 | if timer.timeit(number) >= 0.2: |
|
986 | if timer.timeit(number) >= 0.2: | |
987 | break |
|
987 | break | |
988 | number *= 10 |
|
988 | number *= 10 | |
@@ -1284,5 +1284,4 def _format_time(timespan, precision=3): | |||||
1284 | order = min(-int(math.floor(math.log10(timespan)) // 3), 3) |
|
1284 | order = min(-int(math.floor(math.log10(timespan)) // 3), 3) | |
1285 | else: |
|
1285 | else: | |
1286 | order = 3 |
|
1286 | order = 3 | |
1287 |
ret |
|
1287 | return u"%.*g %s" % (precision, timespan * scaling[order], units[order]) | |
1288 | return ret |
|
General Comments 0
You need to be logged in to leave comments.
Login now