Skip to content

Instantly share code, notes, and snippets.

@JulianNorton
Created February 27, 2018 17:51
Show Gist options
  • Save JulianNorton/c1977ebdafe227dfe06eddc3902959e5 to your computer and use it in GitHub Desktop.
Save JulianNorton/c1977ebdafe227dfe06eddc3902959e5 to your computer and use it in GitHub Desktop.
test how long it takes to print numbers
# 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