github.com/daeuniverse/quic-go@v0.0.0-20240413031024-943f218e0810/internal/utils/ringbuffer/ringbuffer_bench_test.go (about)

     1  package ringbuffer
     2  
     3  import "testing"
     4  
     5  func BenchmarkRingBuffer(b *testing.B) {
     6  	r := RingBuffer[int]{}
     7  	b.ResetTimer()
     8  	for i := 0; i < b.N; i++ {
     9  		r.PushBack(i)
    10  		r.PopFront()
    11  	}
    12  }