tests: using testing.B.Loop

Signed-off-by: yajianggroup <yajianggroup@outlook.com>
This commit is contained in:
yajianggroup 2025-09-23 15:43:02 +08:00
parent 2872242045
commit 33d25b518e

View file

@ -309,7 +309,7 @@ func runBenchmark(b *testing.B, t *StateTest) {
refund uint64
)
b.ResetTimer()
for n := 0; n < b.N; n++ {
for b.Loop() {
snapshot := state.StateDB.Snapshot()
state.StateDB.Prepare(rules, msg.From, context.Coinbase, msg.To, vm.ActivePrecompiles(rules), msg.AccessList)
b.StartTimer()