Example #1
0
func BenchmarkBarrierNoGoroutine(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b Barrier
		b.Fall()
		<-b.Barrier()
	}
}
Example #2
0
func BenchmarkBarrier(b *testing.B) {
	for i := 0; i < b.N; i++ {
		var b Barrier
		go b.Fall()
		<-b.Barrier()
	}
}