import Benchmark from "benchmark"; import SMath from "smath"; const suite = new Benchmark.Suite(); const smath = new SMath(); let result1 = 0; suite.add('SMath.sin', () => { result1 += smath.sin(Math.random()); }); let result2 = 0; suite.add('Math.sin', () => { result2 += Math.sin(Math.random()); }); suite.on('cycle', function(event) { console.log(String(event.target)); }) suite.run();