0.1.3 • Published 4 years ago

devtools-benchmarker v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

devtools - benchmarker - developer tool to measure javascript functions execution time

Install

With npm:

npm install devtools-benchmarker

With yarn:

yarn add devtools-benchmarker

Usage

const benchmarker = require('devtools-benchmarker')

// Function to Test
const somefunction = function () {
    // Some Complex Things
    for (let i = 0; i < 100; i++) {
        for (let j = 0; j < 100; j++) {
            var someComplexCalc = Math.random * 1000 + Math.random * 1000
        }
    }
}
// set precision of measured value
benchmarker.setPrecision(4)

// Measure execution time of function
console.log(benchmarker.measure(somefunction))

Result: example

License

MIT