Created
February 27, 2018 17:51
-
-
Save JulianNorton/c1977ebdafe227dfe06eddc3902959e5 to your computer and use it in GitHub Desktop.
test how long it takes to print numbers
This file contains 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
# time how long a function takes | |
import timeit | |
def display_numbers(): | |
for i in range(1000): | |
print(i) | |
print(timeit.timeit(stmt=display_numbers, number=1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment