reliant/arg-test/test-argy.js

28 lines
606 B
JavaScript

const mod = globalThis.Module || require('./argy.js');
mod().then((module) => {
const benches = [
'_bench_one',
'_bench_two',
'_bench_three',
'_bench_four',
'_bench_five',
'_bench_six',
'_bench_seven',
'_bench_eight'
];
for (const bench of benches) {
console.log(bench);
// warmup
module[bench]();
module[bench]();
const start = performance.now();
// active
module[bench]();
const delta = performance.now() - start;
console.log(`${delta} ms`);
}
});