mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 18:51:28 +00:00
Merge pull request #1501 from nkbai/develop
cors test benchmark doesn't use b.N
This commit is contained in:
commit
130ce7eb1f
@ -225,8 +225,8 @@ func Benchmark_WithoutCORS(b *testing.B) {
|
||||
ctx.Output.SetStatus(500)
|
||||
})
|
||||
b.ResetTimer()
|
||||
for i := 0; i < 100; i++ {
|
||||
r, _ := http.NewRequest("PUT", "/foo", nil)
|
||||
for i := 0; i < b.N; i++ {
|
||||
handler.ServeHTTP(recorder, r)
|
||||
}
|
||||
}
|
||||
@ -246,8 +246,8 @@ func Benchmark_WithCORS(b *testing.B) {
|
||||
ctx.Output.SetStatus(500)
|
||||
})
|
||||
b.ResetTimer()
|
||||
for i := 0; i < 100; i++ {
|
||||
r, _ := http.NewRequest("PUT", "/foo", nil)
|
||||
for i := 0; i < b.N; i++ {
|
||||
handler.ServeHTTP(recorder, r)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user