Skip to content

Commit e229508

Browse files
authored
Apply suggestions from code review
1 parent 5f6a958 commit e229508

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

benchmark_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ func BenchmarkSelect10000rows(b *testing.B) {
129129
return
130130
}
131131

132-
b.StartTimer()
132+
b.ResetTimer()
133133
stmt, err := db.Prepare("SELECT * FROM seq_1_to_10000")
134134
if err != nil {
135135
b.Fatalf("Failed to prepare statement: %v", err)
136136
}
137137
defer stmt.Close()
138-
for n := 0; n < b.N; n++ {
138+
for range b.N {
139139
rows, err := stmt.Query()
140140
if err != nil {
141141
b.Fatalf("Failed to query 10000rows: %v", err)
@@ -151,7 +151,6 @@ func BenchmarkSelect10000rows(b *testing.B) {
151151
}
152152
rows.Close()
153153
}
154-
b.StopTimer()
155154
}
156155

157156
func BenchmarkExec(b *testing.B) {

0 commit comments

Comments
 (0)