It's nothing major, but you can merge the `if` with the `while`:
```python
while time.time() < (started_at + value):
    ...
```