File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ Let's run this with `%%time`-magic and ten million throws:
247247%%timeit
248248calculate_pi(10_000_000)
249249```
250+
250251``` {code-block} console
2512521.07 s ± 30.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
252253```
@@ -268,18 +269,6 @@ def calculate_pi(n_darts):
268269 pi = 4 * hits / n_darts
269270 return pi
270271
271- 30000742 function calls (30000736 primitive calls) in 4.608 seconds
272-
273- Ordered by: internal time
274- List reduced from 150 to 5 due to restriction <5>
275-
276- ncalls tottime percall cumtime percall filename:lineno(function)
277- 4 2.545 0.636 4.005 1.001 {built-in method time.sleep}
278- 20000000 1.091 0.000 1.091 0.000 {method 'random' of '_random.Random' objects}
279- 10000000 0.571 0.000 0.571 0.000 {built-in method math.sqrt}
280- 3 0.172 0.057 0.270 0.090 {method 'poll' of 'select.epoll' objects}
281- 1 0.148 0.148 0.233 0.233 <string>:1(calculate_pi)
282-
283272calculate_pi(10_000_000)
284273```
285274
You can’t perform that action at this time.
0 commit comments