A span of time as measured by `Instant.elapsed()`.
| 53 | |
| 54 | @dataclasses.dataclass(frozen=True) |
| 55 | class Duration: |
| 56 | """A span of time as measured by `Instant.elapsed()`.""" |
| 57 | |
| 58 | start: Instant |
| 59 | stop: Instant |
| 60 | |
| 61 | @property |
| 62 | def seconds(self) -> float: |
| 63 | """Elapsed time of the duration in seconds, measured using a performance counter for precise timing.""" |
| 64 | return self.stop.perf_count - self.start.perf_count |
| 65 | |
| 66 | |
| 67 | @dataclasses.dataclass |