mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 12:47:36 +03:00
* implement and use ringbuffer in framer * Add comments for ring buffer Co-authored-by: Marten Seemann <martenseemann@gmail.com> --------- Co-authored-by: Marten Seemann <martenseemann@gmail.com>
12 lines
183 B
Go
12 lines
183 B
Go
package ringbuffer
|
|
|
|
import "testing"
|
|
|
|
func BenchmarkRingBuffer(b *testing.B) {
|
|
r := RingBuffer[int]{}
|
|
b.ResetTimer()
|
|
for i := 0; i < b.N; i++ {
|
|
r.PushBack(i)
|
|
r.PopFront()
|
|
}
|
|
}
|