github.com/apernet/quic-go@v0.43.1-0.20240515053213-5e9e635fd9f0/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  }