Skip to content

Instantly share code, notes, and snippets.

@1st1
Created February 1, 2016 17:58
Show Gist options
  • Save 1st1/37d928f1e84813bf1c44 to your computer and use it in GitHub Desktop.
Save 1st1/37d928f1e84813bf1c44 to your computer and use it in GitHub Desktop.
import time
class F:
def __init__(self):
self.a = 1
self.b = 2
self.c = 3
self.d = 4
self.e = 5
self.f = 6
self.g = 7
def sub(f):
f.a
f.b
f.c
f.d
f.e
f.f
f.g
def test():
f = F()
t = time.monotonic()
for _ in range(10**8):
sub(f)
print(time.monotonic() - t)
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment