Skip to content

vivianeflowt/devtools-benchmarker

Repository files navigation

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

About

developer tool to measure javascript functions execution time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published