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

Timer clear #21

Closed yunsonbai closed 8 years ago

yunsonbai commented 8 years ago

i use the tMetrology.timer('sss') after i use timer.clear(), the timer.min=0 always, No change

cyberdelia commented 8 years ago

clear will actually reset the timer. So you want either to use in a context manager or using update:

timer = Metrology.timer('responses')
with timer:
    do_something()
yunsonbai commented 8 years ago

I first use clear. then I use the update, but the timer.min has not changed, always 0