Skip to content

DharmarajX24/execution-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Execution Timer

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

Getting Started

1. Installation

# NPM
npm install execution-timer

# Yarn 
yarn add 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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published