~f4814n/frost

frost/mux_test.go -rw-r--r-- 313 bytes
ff15c3c0Fabian Geiselhart Add screenshots 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package frost

import "testing"

func BenchmarkMux(b *testing.B) {
	mux := NewMux()
	go mux.Run()

	b.RunParallel(func(pb *testing.PB) {
		for pb.Next() {
			id, _, tx := mux.Register()
			tx <- testEvent{}
			mux.Unregister(id)
		}
	})

	mux.Stop()
}

type testEvent struct{}

func (e testEvent) FrostEvent() {}