Skip to content

Instantly share code, notes, and snippets.

@yptheangel
Created September 1, 2019 11:20
Show Gist options
  • Save yptheangel/312021d3c52cc001d8778280e24eadc1 to your computer and use it in GitHub Desktop.
Save yptheangel/312021d3c52cc001d8778280e24eadc1 to your computer and use it in GitHub Desktop.
import timeit
import time
start_time = timeit.default_timer()
# Using time module to create the delay, you can replce this line with your process
time.sleep(1)
end_time = timeit.default_timer()
elapsed_time = end_time - start_time
# Round the elapsed time to 2 decimal points
print("Elapsed time: {}".format(round(elapsed_time,2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment