go netpoll_os_test 源码
golang netpoll_os_test 代码
文件路径:/src/runtime/netpoll_os_test.go
package runtime_test
import (
"runtime"
"sync"
"testing"
)
var wg sync.WaitGroup
func init() {
runtime.NetpollGenericInit()
}
func BenchmarkNetpollBreak(b *testing.B) {
b.StartTimer()
for i := 0; i < b.N; i++ {
for j := 0; j < 10; j++ {
wg.Add(1)
go func() {
runtime.NetpollBreak()
wg.Done()
}()
}
}
wg.Wait()
b.StopTimer()
}
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
7、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦