sc-benchmark
A package for benchmarking functions.
Inspired somewhat by the Go testing package.
Install
npm install --save sc-benchmark
Usage
const Suite = Suite; let s = ; // Add a named benchmark. Note that the argument `N` passed to the callback// function to run the test: the function should always include a for loop that// runs the test N times. This is done *inside* the test rather than as part of// the framework to reduce function call overhead.s; // Optionally, the test can use the second `timer` object argument. Currently,// it has a single method `start()` which tells the test when to start timing.// This allows the test to do up front setup outside of the timed section of// code. If timer.start() is not called, the timing information implicitly// starts as soon as the test function begins.s; // Start the benchmarkss;