Metadata-Version: 2.1
Name: magic-timer
Version: 0.0.9
Summary: Conveniently get a rough idea of how long things take.
Home-page: https://github.com/sradc/magic-timer
Author: Sidney Radcliffe
Author-email: sidneyradcliffe@gmail.com
License: UNKNOWN
Description: # magic-timer
        
        [![](https://github.com/sradc/magic-timer/workflows/Python%20package/badge.svg)](https://github.com/sradc/magic-timer/commits/)
        
        
        `pip install magic-timer`
        
        
        A simple timer. Conveniently get a rough idea of how long things take.
        
        
        #### Use via decorator:
        
        ```python
        from magic_timer import MagicTimer, magic_timer
        import time
        
        @magic_timer
        def some_slow_function():
            time.sleep(2.75)
        
        some_slow_function()
        ```
        
        ```
        > 'some_slow_function' - 2.8 seconds
        ```
        
        
        #### Use via MagicTimer object:
        
        ```python
        def some_slow_function():
            time.sleep(90/1000)
          
        timer = MagicTimer()
        
        some_slow_function()
        
        print(timer)
        ```
        
        ```
        > 94 milliseconds
        ```
        
        
        See also this [notebook](https://github.com/sradc/magic-timer/blob/master/magic-timer_nb.ipynb).
        
        This package is tiny. It uses time.time() to measure time. For greater precision & accuracy, you could use something like [timeit](https://docs.python.org/3.8/library/timeit.html).
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.0
Description-Content-Type: text/markdown
