benchmark-javascript

1.3.6 • Public • Published

Benchmark

Counts how much time, memory, cpu spent on specific function.
Additional outputs:

  1. Average error per function.
  2. Difference between best time function and current one.

Script

add this script in your package.json file

  "scripts": {
    "benchmark": "node ./node_modules/benchmark-javascript/dist/index.js"
  },

Start command

npm run benchmark path iterations runs

path : /folder/folder/file.extension
iterations : should be number
runs : should be number

File should look like

export const functions = {   
    'title': 'functions.ts',   
    'tests': [   
        {   
            'title': 'Function Name',   
            'func': (): number =>{   
                // function body
            },   
        }   
    ]   
};

Readme

Keywords

none

Package Sidebar

Install

npm i benchmark-javascript

Weekly Downloads

6

Version

1.3.6

License

ISC

Unpacked Size

18.9 kB

Total Files

16

Last publish

Collaborators

  • handeye