@0x2e757/benchmark

Benchmarking library

Usage no npm install needed!

<script type="module">
  import 0x2e757Benchmark from 'https://cdn.skypack.dev/@0x2e757/benchmark';
</script>

README

Benchmark

Library for code performance testing using Node.js

Installation

npm i @0x2e757/benchmark

Usage example

If used in JavaScript import as:

const benchmark = require("@0x2e757/benchmark");

If used in TypeScript import as:

import * as benchmark from "@0x2e757/benchmark";

Benchmark your code:

benchmark.test({

    "case 1": () => {
        // Some code
    },

    "case 2": () => {
        // Another code
    },

});