summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2021-02-05 05:36:03 (GMT)
committerGitHub <noreply@github.com>2021-02-05 05:36:03 (GMT)
commitd9dda32040f2c664321e3f9c189154e93726e397 (patch)
treec20bd6e89631ee0647b65c08bf6baf9b1fd34aa0 /Lib/random.py
parentd938816acf71a74f1bd13fdf0534b3d9ea962e44 (diff)
downloadcpython-d9dda32040f2c664321e3f9c189154e93726e397.zip
cpython-d9dda32040f2c664321e3f9c189154e93726e397.tar.gz
cpython-d9dda32040f2c664321e3f9c189154e93726e397.tar.bz2
Reduce overhead on random timings (GH-24455)
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 187b0a0..0df2664 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)