var-7-instance-meth.py 219 B

1234567891011121314151617
  1. import bench
  2. class Foo:
  3. def __init__(self):
  4. self._num = 20000000
  5. def num(self):
  6. return self._num
  7. def test(num):
  8. o = Foo()
  9. i = 0
  10. while i < o.num():
  11. i += 1
  12. bench.run(test)