99[drifts](#missed-ticks-and-drifting)), you can use
1010a [`Timer`][frequenz.channels.timer.Timer] like this:
1111
12- Example: Periodic Timer
12+ Example: Periodic Timer Example
1313 ```python
1414 import asyncio
1515 from datetime import datetime, timedelta
@@ -25,11 +25,16 @@ async def main() -> None:
2525 asyncio.run(main())
2626 ```
2727
28+ This timer will tick as close as every second as possible, even if the loop is busy
29+ doing something else for a good amount of time. In extreme cases, if the loop was
30+ busy for a few seconds, the timer will trigger a few times in a row to catch up, one
31+ for every missed tick.
32+
2833If, instead, you need a timeout, for example to abort waiting for other receivers after
2934a certain amount of time, you can use a [`Timer`][frequenz.channels.timer.Timer] like
3035this:
3136
32- Example: Timeout
37+ Example: Timeout Example
3338 ```python
3439 import asyncio
3540 from datetime import timedelta
@@ -57,8 +62,10 @@ async def main() -> None:
5762 asyncio.run(main())
5863 ```
5964
60- This timer will *rearm* itself automatically after it was triggered, so it will trigger
61- again after the selected interval, no matter what the current drift was.
65+ This timer will *rearm* itself automatically after it was triggered, so it will
66+ trigger again after the selected interval, no matter what the current drift was. So
67+ if the loop was busy for a few seconds, the timer will trigger immediately and then
68+ wait for another second before triggering again. The missed ticks are skipped.
6269
6370Tip:
6471 It is extremely important to understand how timers behave when they are
@@ -486,7 +493,7 @@ def __init__( # pylint: disable=too-many-arguments
486493 ) -> None :
487494 """Create an instance.
488495
489- See the class documentation for details.
496+ See the [ class documentation][frequenz.channels.timer.Timer] for details.
490497
491498 Args:
492499 interval: The time between timer ticks. Must be at least
0 commit comments