From: Raymond Hettinger Date: Fri, 5 Feb 2021 05:36:03 +0000 (-0800) Subject: Reduce overhead on random timings (GH-24455) X-Git-Tag: v3.10.0a6~117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9dda32040f2c664321e3f9c189154e93726e397;p=thirdparty%2FPython%2Fcpython.git Reduce overhead on random timings (GH-24455) --- diff --git a/Lib/random.py b/Lib/random.py index 187b0a016947..0df26645d9e1 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -881,7 +881,7 @@ def _test_generator(n, func, args): from time import perf_counter t0 = perf_counter() - data = [func(*args) for i in range(n)] + data = [func(*args) for i in _repeat(None, n)] t1 = perf_counter() xbar = mean(data)