1.3.6 • Published 3 years ago
benchmark-javascript v1.3.6
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
},
}
]
};