Metadata-Version: 2.1
Name: timeblock
Version: 0.0.4
Summary: Time blocks of code using a context manager
Author-email: Daniel Hails <timeblock@hails.info>
Project-URL: Homepage, https://github.com/DJRHails/timeblock
Project-URL: Bug Tracker, https://github.com/DJRHails/timeblock/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# 🕐 timeblock

Helpful snippet for timing blocks, basically [contexttimer](https://github.com/brouberol/contexttimer) with a few tweaks / forked.

```bash
pip install timeblock==0.0.4
```

```python
from timeblock import Timer

with Timer() as timer:
    sleep(1)

print(timer.elapsed) # 1s

with Timer(output=True):
    sleep(1)

# logger.debug(f"Elapsed time: {timer.elapsed}"

with Timer("sleepy time", output=print):
    sleep(1)

# print("sleepy time took {:.3f} seconds".format(timer.elapsed))
```
