Created
May 30, 2019 18:32
-
-
Save StuartFarmer/7b13a9f077342ca4fe181ce6303c5251 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 timeit | |
setup = ''' | |
class c: | |
def __enter__(self): | |
pass | |
def __exit__(self, type, value, traceback): | |
pass | |
''' | |
statement = ''' | |
with c(): | |
pass | |
''' | |
w = timeit.timeit(statement, setup=setup) | |
print('With setup and cleanup time: {}'.format(w)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment