devtools-benchmarker

0.1.3 • Public • Published

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

Package Sidebar

Install

npm i devtools-benchmarker

Weekly Downloads

6

Version

0.1.3

License

MIT

Unpacked Size

11.1 kB

Total Files

7

Last publish

Collaborators

  • vivianeflowt