How to Write Benchmarks in Go with testing.B

Write a function accepting *testing.B that loops b.N times around your code to measure performance.

Write a benchmark function named BenchmarkX that accepts a *testing.B parameter and loops b.N times around the code you want to measure.

func BenchmarkSplitSeqEmptySeparator(b *testing.B) {
	for range b.N {
		for range SplitSeq(benchInputHard, nil) {
		}
	}
}

Run it with go test -bench=BenchmarkSplitSeqEmptySeparator.