execution-timer
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Execution Timer

A simple node package to measure execution time of your NodeJS Application

Getting Started

1. Installation

npm install execution-timer

2. Start a process

const exeTimer = require("execution-timer")

const newProcess = exeTimer.start("newProcessName")
// ⇨ {result: true, pid: "newProcessName"}
// A random PID is returned if name is not provided.

3. Stop a process

const exeTimer = require("execution-timer")

const newProcess = exeTimer.start("newProcessName")
exeTimer.stop(newProcess.pid)
// ⇨ {result: true, data: "newProcessName: 24 ms"}
// Returns false with an error in data parameter if something goes wrong.

3. Stop all processess

const exeTimer = require("execution-timer")

const newProcess1 = exeTimer.start("newProcessName1") 
const newProcess2 = exeTimer.start("newProcessName2") 

exeTimer.stopAll() // ⇨ true
// Stops all running processes.

4. List all processess

const exeTimer = require("execution-timer")

exeTimer.list() // ⇨ logs a table containing all "completed" processes with their execution time

Package Sidebar

Install

npm i execution-timer

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

5.03 kB

Total Files

5

Last publish

Collaborators

  • dharmaraj24