results = {
return new Promise((resolve) => {
const results = [];
const s = new Benchmark.Suite("splice");
let x = Array.from({ length: 1000 }, (_, i) => i);
let input = Array.from({ length: 100 }, (_, i) => i);
s.add("splice", function () {
x.slice().splice(100, 0, ...input);
})
.add("slice", function () {
x.slice(0, 100).concat(input).concat(x.slice(100));
})
.on("cycle", (e) => results.push(String(e.target)))
.on("finish", resolve(results))
.run();
});
}