# @marcosrv-ull/easybenchmarkjs

> a light tool to benchmark functions in js

Latest version **1.0.10** (published 2022-03-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @marcosrv-ull/easybenchmarkjs
pnpm add @marcosrv-ull/easybenchmarkjs
yarn add @marcosrv-ull/easybenchmarkjs
bun add @marcosrv-ull/easybenchmarkjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2022-03-17 |
| First published | 2022-03-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marcos Rodríguez Vega |
| Maintainers | marcosrv-ull |
| Keywords | benchmark, easy, javascript |

## Links

- npm: https://www.npmjs.com/package/@marcosrv-ull/easybenchmarkjs
- Repository: https://github.com/marcosrv-ULL/easyBenchmarkjs
- Homepage: https://github.com/marcosrv-ULL/easyBenchmarkjs#readme
- Issues: https://github.com/marcosrv-ULL/easyBenchmarkjs/issues
- npm.io page: https://npm.io/package/@marcosrv-ull/easybenchmarkjs

## Dependencies (1)

- [mocha](https://npm.io/package/mocha.md) ^9.2.2

## Recent versions

- 1.0.10 (latest) — 2022-03-17
- 1.0.9 — 2022-03-17
- 1.0.8 — 2022-03-17
- 1.0.7 — 2022-03-17
- 1.0.6 — 2022-03-17
- 1.0.5 — 2022-03-17

## README

[![npm version](https://badge.fury.io/js/%40marcosrv-ull%2Feasybenchmarkjs.svg)](https://badge.fury.io/js/%40marcosrv-ull%2Feasybenchmarkjs)

## easybenchmark.js

A really light tool to benchmark functions in js

## Installation

For the package installation you only have to:

```
npm i @marcosrv-ull/easybenchmarkjs
```

## Usage from code:

```javascript
const easybenchmarkjs = require('@marcosrv-ULL/easybenchmarkjs');
const fastBench = easybenchmarkjs.fastBench;
```

[The documentation of the function](https://marcosrv-ull.github.io/easyBenchmarkjs/).

## Examples

This is the main idea of the function:
```javascript
const easybenchmarkjs = require('@marcosrv-ULL/easybenchmarkjs');
const fastBench = easybenchmarkjs.fastBench;

const myFunction = (whatEverAreTheParams) => {
    // Do things
}

const TIMES_TO_BE_EXECUTED = 10;
let argumentA;
let argumentB;
.
.
.
let argumentN;
console.log(`Mean time elapsed with ${TIMES_TO_BE_EXECUTED} executions: ${easybenchmarkjs.fastBench(myFunction, [argumentA, argumentB, ..., argumentN], TIMES_TO_BE_EXECUTED)} ms`);
```

Output:
```
Mean time elapsed with 10 executions: <result_in_ms> ms
```
## Author

marcosrv-ull

## Tests

Execute:
```
npm run versions
mocha
```

---
_Source: https://npm.io/package/@marcosrv-ull/easybenchmarkjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
