mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
20 lines
259 B
Go
20 lines
259 B
Go
|
package benchmarks
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func BenchmarkChanMakeClose(b *testing.B) {
|
||
|
b.StopTimer()
|
||
|
b.StartTimer()
|
||
|
|
||
|
for j := 0; j < b.N; j++ {
|
||
|
foo := make(chan struct{})
|
||
|
close(foo)
|
||
|
something, ok := <-foo
|
||
|
if ok {
|
||
|
b.Error(something, ok)
|
||
|
}
|
||
|
}
|
||
|
}
|