Skip to content

Commit f4d87ea

Browse files
committed
fix: use microseconds in benchmark JSON to preserve sub-millisecond precision
1 parent 3eb06d0 commit f4d87ea

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/e2e/evm_test_common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,11 +964,11 @@ func writeTraceBenchmarkJSON(t testing.TB, label string, spans []traceSpan, outp
964964
var entries []benchmarkEntry
965965
for _, name := range names {
966966
s := m[name]
967-
avg := float64(s.total.Milliseconds()) / float64(s.count)
967+
avg := float64(s.total.Microseconds()) / float64(s.count)
968968
entries = append(entries,
969-
benchmarkEntry{Name: fmt.Sprintf("%s - %s (avg)", label, name), Unit: "ms", Value: avg},
970-
benchmarkEntry{Name: fmt.Sprintf("%s - %s (min)", label, name), Unit: "ms", Value: float64(s.min.Milliseconds())},
971-
benchmarkEntry{Name: fmt.Sprintf("%s - %s (max)", label, name), Unit: "ms", Value: float64(s.max.Milliseconds())},
969+
benchmarkEntry{Name: fmt.Sprintf("%s - %s (avg)", label, name), Unit: "us", Value: avg},
970+
benchmarkEntry{Name: fmt.Sprintf("%s - %s (min)", label, name), Unit: "us", Value: float64(s.min.Microseconds())},
971+
benchmarkEntry{Name: fmt.Sprintf("%s - %s (max)", label, name), Unit: "us", Value: float64(s.max.Microseconds())},
972972
)
973973
}
974974

0 commit comments

Comments
 (0)