Metadata-Version: 2.1
Name: noiftimer
Version: 2.4.0
Summary: Timing class for measuring elapsed time and average elapsed time.
Project-URL: Homepage, https://github.com/matt-manes/noiftimer
Project-URL: Documentation, https://github.com/matt-manes/noiftimer/tree/main/docs
Project-URL: Source code, https://github.com/matt-manes/noiftimer/tree/main/src/noiftimer
Author: Matt Manes
License-File: LICENSE.txt
Keywords: timer,timing
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: printbuddies
Requires-Dist: pytest
Requires-Dist: typing-extensions
Description-Content-Type: text/markdown

# noiftimer
Simple timer class to track elapsed time.<br>
Install with:
<pre>pip install noiftimer</pre>

Usage:
<pre>
>>> from noiftimer import Timer, time_it
>>> import time
</pre>
Timer object
<pre>
>>> def very_complicated_function():
...     time.sleep(1)
...
>>> timer = Timer()
>>> for _ in range(10):
...     timer.start()
...     very_complicated_function()
...     timer.stop()
...
>>> print(timer.stats)
elapsed time: 1s 1ms 173us
average elapsed time: 1s 912us
>>> timer.elapsed
1.001173496246338
>>> timer.elapsed_str
'1s 1ms 173us'
>>> timer.average_elapsed
1.0009121656417848
>>> timer.average_elapsed_str
'1s 912us'
</pre>
time_it decorator (executes the decorated function 10 times)
<pre>
>>> @time_it(10)
... def very_complicated_function():
...     time.sleep(1)
...
>>> very_complicated_function()
very_complicated_function average execution time: 1s 469us
</pre>
