Last active
October 27, 2022 04:59
-
-
Save danielkon96/7f445b8e06c47cbe57bbf2fad86c8c34 to your computer and use it in GitHub Desktop.
This file contains 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
async function sample_benchmark() { | |
const benchOptions = { | |
id: "Suite Name", | |
log: customLogger, | |
minIterations: 3 | |
}; | |
const bench = new Bench(benchOptions); | |
// Benchmark Group 1 | |
bench.group("Group Name 1") | |
.addAsync(null, 'sleep_async', | |
async () => { | |
await sample_function_sleep_async() | |
}, | |
null); | |
// Benchmark Group 2 | |
bench.group("Group Name 2") | |
.add(null, 'math_sqrt', | |
() => { | |
sample_function_math_sqrt() | |
}, | |
null); | |
// Run our helper function runBenchmark(...) | |
await runBenchmarks(bench); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment