Skip to content

Instantly share code, notes, and snippets.

@rayanfer32
Last active December 9, 2019 08:04
Show Gist options
  • Save rayanfer32/01bba89fc3e943ec22d1c7d346a94849 to your computer and use it in GitHub Desktop.
Save rayanfer32/01bba89fc3e943ec22d1c7d346a94849 to your computer and use it in GitHub Desktop.
class stopwatch:
import time
def start():
store = time.time()
return store
def stop(store):
elapsed = time.time() - store
print("elapsed",elapsed,"seconds!")
## eg (set a variable with current time):
# eg_time = stopwatch.start()
# stopwatch.stop(eg_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment