Skip to content

Commit 625a704

Browse files
committed
feat: add code pre
1 parent 7e70178 commit 625a704

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

zh/11.3.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ func Benchmark_TimeConsumingFunction(b *testing.B) {
154154
```
155155

156156
我们执行命令`go test webbench_test.go -test.bench=".*"`,可以看到如下结果:
157-
157+
```
158158
Benchmark_Division-4 500000000 7.76 ns/op 456 B/op 14 allocs/op
159159
Benchmark_TimeConsumingFunction-4 500000000 7.80 ns/op 224 B/op 4 allocs/op
160160
PASS
161161
ok gotest 9.364s
162+
```
162163

163164
上面的结果显示我们没有执行任何`TestXXX`的单元测试函数,显示的结果只执行了压力测试函数,第一条显示了`Benchmark_Division`执行了500000000次,每次的执行平均时间是7.76纳秒,第二条显示了`Benchmark_TimeConsumingFunction`执行了500000000,每次的平均执行时间是7.80纳秒。最后一条显示总共的执行时间。
164165

0 commit comments

Comments
 (0)