Skip to content

Commit 71bb1d0

Browse files
authored
Update models.py
1 parent 5ea51d9 commit 71bb1d0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ohip_bench/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
from typing import Any, Optional
2525

2626

27+
def _round_ms(value: float) -> float:
28+
return round(float(value), 6)
29+
30+
2731
class BenchmarkDomain(str, Enum):
2832
CONSENT = "CONSENT"
2933
SAFETY = "SAFETY"
@@ -155,7 +159,7 @@ class BenchmarkResult:
155159

156160
@property
157161
def duration_ms(self) -> float:
158-
return max(0.0, (float(self.finished_at_utc_s) - float(self.started_at_utc_s)) * 1000.0)
162+
return max(0.0, _round_ms((float(self.finished_at_utc_s) - float(self.started_at_utc_s)) * 1000.0))
159163

160164
def to_dict(self) -> dict[str, Any]:
161165
return {

0 commit comments

Comments
 (0)