diff --git a/flake_test.go b/flake_test.go index ac1a2e2..b002139 100644 --- a/flake_test.go +++ b/flake_test.go @@ -20,6 +20,21 @@ func BenchmarkGenerateChan(b *testing.B) { } +// Benchmarks Presence Update event with fake data. +func BenchmarkGenerateChanParallel(b *testing.B) { + + node, _ := NewFlakeNode(1) + c := make(chan Flake) + go node.Generator(c) + + b.ReportAllocs() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + <-c + } + }) +} + // Benchmarks Presence Update event with fake data. func BenchmarkGenerate(b *testing.B) {