I hereby claim:
- I am sofaking1337 on github.
- I am sofaking1337 (https://keybase.io/sofaking1337) on keybase.
- I have a public key ASA7oG0YE0pxLqa9MwbvnV5mWYNy2pg-la-XJdyGUwOYCQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Timer start! | |
This code is indeed arbitrary | |
How long was I out? | |
Execution time was 2.00782608986 seconds |
with SimpleTimer(): | |
print "This code is indeed arbitrary" | |
time.sleep(2) | |
print "How long was I out?" |
import time | |
class SimpleTimer(object): | |
def __init__(self): | |
self.start_time = time.time() | |
def __enter__(self): | |
print "Timer start!" |
with open('some_file.txt', 'r') as input: | |
for line in input: | |
print line |