🧑💻🕸️ Simple, fun npm package for Node.js & The Browser 🕸️🧑💻
Install using npm npm
:
npm install aet-time
- You have multiple algorithms in your code
- You need to find the faster algorithm
- Don't have the time to check the complexity
- Find the faster code by using this package
Let's get started by writing a test for a hypothetical function that runs a loop. First, create a script.js
file:
function fun1() {
for (let index = 0; index < 100; index++){}
}
Now let's add another function to compare with the previous one in the same script.js
file:
function fun2() {
for (let index = 0; index < 100000; index++){}
}
Now lets import the package into the file to find which function is faster:
const aet = require('aet')
console.log(aet(fun1, fun2));
Your final code should look something like this:
const aet = require('aet')
function fun1() {
for (let index = 0; index < 100000; index++){}
}
function fun2() {
for (let index = 0; index < 1000000000; index++){}
}
console.log(aet(fun1, fun2));
Replace the dummy functions fun1
and fun2
with the algorithms you made and want to compare.
-1
1
0
Feel free to contribute to this project by opening issues and pull requests
This is an MIT licenced Project