Created
August 22, 2014 12:52
-
-
Save tbillington/83fd13a4edb0c7580cd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab your time module ! | |
import time | |
# Capture the time at the start of your program | |
time_at_start = time.time() | |
# The code you want to time goes here | |
for i in range(1,billion): | |
foo() | |
blah() | |
# End of code to be timed | |
# Capture the elapsed time between the start and now (the end of your program) | |
time_at_end = time.time() - time_at_start | |
# Print it ! Easy as pie ! | |
print(time_at_end) | |
> 13.28290414810181 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment