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

Allow to use timer and meter as decorators and with context manager #24

Closed misiek08 closed 8 years ago

misiek08 commented 8 years ago

Possible usage:

def test_context():
    for i in range(0, 5000):
        with Metrology.meter('meter_context_5000'):
            pass

@Metrology.meter('meter_decorator')
def text_decorator():
    pass

This change applies only to timer and meter

vi4m commented 8 years ago

Cool!

ar4s commented 8 years ago

shut-up-and-take-my-money1

ghost commented 8 years ago

Awesome

cyberdelia commented 8 years ago

Can you look into adding tests and documentation?

misiek08 commented 8 years ago

I've just added tests for new functionality and wrote example to ReadME, so everyone can use it :)

cyberdelia commented 8 years ago

Thanks :bowtie: