Skip to main content
Version: Next

Get Started

moment-machine is an open source package that you can use to easily get and check the execution time of your functions.

What you'll need

To use moment-machine, you need Node.js with any version you want

install

You can use moment-machine in various frameworks and libraries, such as React.js, Next.js, Express.js, Fastify and other tools available in npm .

npm i --save-dev moment-machine

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to use moment-machine.

Usage example

In this way, you can get the execution time of the function with moment-machine:

const momentMachine = require('moment-machine');

const testFunction = ()=>{
let a = 2345345436;
let b = 45364536457;
let c = a * b;
c = c**2
}

momentMachine.getRuntime(testFunction) //0.009

In the following, we discuss other moment-machine methods and how to use this package