aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2021-02-04 21:36:03 -0800
committerGitHub <noreply@github.com>2021-02-04 21:36:03 -0800
commitd9dda32040f2c664321e3f9c189154e93726e397 (patch)
treec20bd6e89631ee0647b65c08bf6baf9b1fd34aa0
parentbpo-35295: Remove outdated comment. (GH-24453) (diff)
downloadcpython-d9dda32040f2c664321e3f9c189154e93726e397.tar.gz
cpython-d9dda32040f2c664321e3f9c189154e93726e397.tar.bz2
cpython-d9dda32040f2c664321e3f9c189154e93726e397.zip
Reduce overhead on random timings (GH-24455)
-rw-r--r--Lib/random.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 187b0a01694..0df26645d9e 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)