Created
March 20, 2017 17:58
-
-
Save SofaKing1337/ef8eea9df78832eb2c7c5bbb898e5d47 to your computer and use it in GitHub Desktop.
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
import time | |
class SimpleTimer(object): | |
def __init__(self): | |
self.start_time = time.time() | |
def __enter__(self): | |
print "Timer start!" | |
def __exit__(self, exception_type, exception_value, traceback): | |
print "Execution time was {} seconds".format(time.time() - self.start_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment