cyberdelia / metrology

A library to easily measure what's going on in your python.
https://metrology.readthedocs.org
MIT License
309 stars 25 forks source link

TypeError when decrementing Counter #12

Closed yanjost closed 11 years ago

yanjost commented 11 years ago

I have a counter and try to decrement it, it raises a TypeError

 File "<snip-snip>/lib/python2.7/site-packages/metrology/instruments/timer.py", line 40, in __exit__
    self.update(duration)
  File "<snip-snip>/lib/python2.7/site-packages/metrology/instruments/timer.py", line 27, in update
    self.meter.mark()
  File "<snip-snip>/lib/python2.7/site-packages/metrology/instruments/meter.py", line 12, in wrapper
    self._tick()
  File "<snip-snip>/lib/python2.7/site-packages/metrology/instruments/meter.py", line 41, in _tick
    for _ in range(ticks):
exceptions.TypeError: range() integer end argument expected, got float.
cyberdelia commented 11 years ago

Definitely a bug, should be easy to fix, will do that a bit later. Thanks!

yanjost commented 11 years ago

Thanks, it works !