perf-test-helper

0.0.1 • Public • Published

Performance test helper

A tiny module to help test the performance of functions. It uses perf_hooks under the hood.

Usage

const perfTestHelper = require('perf-test-helper')

function functionToTest(numbers) {
  return numbers.reduce((acc, val) => acc + val, 0)
}

const averageTime = perfTestHelper({
  iterations: 100,
  functionUnderTest: functionToTest,
  parameters: [
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  ]
}) 
// 0.115 (result is in milliseconds)

/perf-test-helper/

    Package Sidebar

    Install

    npm i perf-test-helper

    Weekly Downloads

    0

    Version

    0.0.1

    License

    ISC

    Unpacked Size

    2.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • nkhil