We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee9b5ce commit 7f485eaCopy full SHA for 7f485ea
Doc/library/timeit.rst
@@ -44,8 +44,12 @@ This can be achieved from the :ref:`python-interface` with::
44
>>> timeit.timeit('"-".join(map(str, range(100)))', number=10000)
45
0.23702679807320237
46
47
+A callable can also be passed from the :ref:`python-interface`::
48
-Note however that :mod:`timeit` will automatically determine the number of
49
+ >>> timeit.timeit(lambda: "-".join(map(str, range(100))), number=10000)
50
+ 0.19665591977536678
51
+
52
+Note however that :func:`.timeit` will automatically determine the number of
53
repetitions only when the command-line interface is used. In the
54
:ref:`timeit-examples` section you can find more advanced examples.
55
0 commit comments