Skip to content

Commit 6eaf276

Browse files
Nicolas VincentNicolas Vincent
authored andcommitted
measuring-code-execution-time.md updated from https://stackedit.io/
1 parent 786b25c commit 6eaf276

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

measuring-code-execution-time.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ However, it is much more challenging to remove the systematic error.
1919
**The idea is to first measure the time of _one_ function call, then the time of _two_, then the time of three, and so on....**
2020
You can then fit a straight line through the measurements. The overall execution time can then be obtained by taking the slope `a` from the straight line `y = a x + b`.
2121
This type of measurement is very robust against occasional measurements with large errors. This can be visualized by artificially changing one measurement and rerunning the line fitting process.
22+
23+
## Code Samples
24+
Gist [bench.py](https://gist.github.com/NicovincX2/58bf32e1555a1f617191ea578a5ec6d3)
2225
<!--stackedit_data:
23-
eyJoaXN0b3J5IjpbLTE1Nzk0NjU0MTAsLTE3MDk1MTI4MDFdfQ
24-
==
26+
eyJoaXN0b3J5IjpbLTE4NDM4MDM0OTMsLTE1Nzk0NjU0MTAsLT
27+
E3MDk1MTI4MDFdfQ==
2528
-->

0 commit comments

Comments
 (0)