Last active
May 22, 2021 13:00
-
-
Save gpoole/dcc40f42354b790db9d6d3182eb79064 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment