elapsed property

Duration get elapsed

The time this Timer have been active.

If the timer is paused, the elapsed time is also not computed anymore, so elapsed is always less than or equals to the duration.

Implementation

Duration get elapsed => _stopwatch?.elapsed ?? duration;