https://github.com/tendermint/tendermint
Raw File
Tip revision: aa40cfcbb97fac3832b47ccdcf99c6b7fb504cb2 authored by Ethan Buchman on 16 January 2019, 21:01:58 UTC
Merge pull request #3135 from tendermint/release/v0.28.0
Tip revision: aa40cfc
chan_test.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)
		}
	}
}
back to top