andrew-algometer

1.1.0 • Public • Published

Algometer

algometer Algometer is a CLI tool to measure the execution time of JavaScript/TypeScript algorithms.

Features

  • It gives you the execution time of a function in milliseconds.
  • You can call it from anywhere in your code by importing the Algometer function and passing an arrow function containing the algorithm as its argument. Please be sure to run that file with Node, or else Algometer might not work.
  • It works with both pure JavaScript and TypeScript.

Example:

import Algometer from "../base/algometer";

Algometer(()=>{
    let result: number;
    const k = 12;

    for(let i = 0; i < 80000; i++)
        for(let j = 0; j < 80000; j++)
                result = i * (j*j) + (k*k) - (j + k) - (i*i) * j;
})

Source code and download

Algometer can be installed with npm i andrew-algometer. You can also view its source code in its official GitHub repository right here.

Package Sidebar

Install

npm i andrew-algometer

Weekly Downloads

5

Version

1.1.0

License

ISC

Unpacked Size

13 kB

Total Files

11

Last publish

Collaborators

  • andrewnation