Closed shaocongliang closed 5 years ago
The "ok" time is the total time it takes to run the test program. The time reported for the benchmark is the approximate time it takes to run just that code. The "ok" time is reported mainly for interest when running non-benchmark tests. When only running benchmarks, you may as well ignore it.
I'm going to close this issue because there is nothing to do. In general we don't use the issue tracker for questions, and you will get better answers on a forum. See https://golang.org/wiki/Questions.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
not sure
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run a benchmark case but the output time makes me feel puzzled.
This bench case need some extra init job so I reset the timer. Here is the partial code
"ok" time is 3.828 and the "Download" time is 252492668*5 ~= 1.7s. Obviously there is a big gap. What's the meaning of "ok" time? The whole time of this bench execution? Or the time after reset timer?
One possible reason of the difference in "ok" and "Download" I think may be due to wg.Wait() . So I add a sleep statement after the wg.Wait()
Here is the output
Why is the "Download" time increasing a lot?
Add a sleep before b.ResetTimber()
18.950?
What did you expect to see?
May be you can give a link page explain the output meaning of test.bench. I can't find on https://golang.org/pkg/testing/
What did you see instead?