| 92 | return math.sqrt(variance) |
| 93 | |
| 94 | def execution_time_report(self, detailed = False) -> tuple[float, str]: |
| 95 | if detailed: |
| 96 | mean_execution_time = self.mean_execution_time |
| 97 | return ( |
| 98 | mean_execution_time, |
| 99 | f"{self.min_execution_time:.2f} / {mean_execution_time :.2f} ±{self.stddev_execution_time:.2f} / {self.max_execution_time:.2f} ms" |
| 100 | ) |
| 101 | else: |
| 102 | # Use minimum execution time to account for variations / other |
| 103 | # things the system was doing |
| 104 | min_execution_time = self.min_execution_time |
| 105 | return ( |
| 106 | min_execution_time, |
| 107 | f"{min_execution_time :.2f} ms" |
| 108 | ) |
| 109 | |
| 110 | |
| 111 | @dataclass |