UNPKG
cirbuf
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
A tiny and fast circular buffer
cirbuf
/
benchmarks
/
cirbuf-big.js
13 lines
(10 loc)
•
251 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
let
{
CircularBuffer
} =
require
(
"../dist"
)
let
iterations =
10_000_000
let
max =
1_000_000
module
.
exports
=
() =>
{
let
buffer =
new
CircularBuffer
(max)
for
(
let
i =
0
; i < iterations; i++) { buffer.
push
(i) }
return
buffer.
toArray
().
length
}