
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
performance-time-tracker
Advanced tools
A Node.js package for performance time tracking of functions or scripts
A simple and lightweight Node.js utility to measure the execution time of your functions or code blocks. Ideal for benchmarking, profiling, or just keeping an eye on performance.
You can install the package using npm:
npm install performance-time-tracker --save
const {startMonitoring, stopMonitoring} = require('performance-time-tracker');
// Start monitoring a function
startMonitoring('myFunction');
// Call your function here
// Stop monitoring the function
stopMonitoring();
OR
const {track} = require('performance-time-tracker');
const wrappedAsyncFunction = track('myFunction', asyncFunction);
await wrappedAsyncFunction();
To measure how long a function or code block takes to run, wrap it between startMonitoring(label) and stopMonitoring().
The label is a name you give the block you're monitoring—this helps identify it in the output.
You can use this for both synchronous and asynchronous functions.
const {startMonitoring, stopMonitoring} = require('performance-time-tracker');
const asyncFunction = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve('Response after 3 seconds');
}, 3000);
});
};
startMonitoring('myFunction'); //give lable (in string) of your function so you can identify
await asyncFunction();
stopMonitoring();
//result
//Execution started for function "myFunction".
//[1] [myFunction] - Execution Time: 3000.00 ms
OR
const {track} = require('performance-time-tracker');
const asyncFunction = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve('Response after 3 seconds');
}, 3000);
});
};
const wrappedAsyncFunction = track('myFunction', asyncFunction);
await wrappedAsyncFunction();
//result
//Execution started for function "myFunction".
//[1] [myFunction] - Execution Time: 3000.00 ms
You can monitor multiple functions sequentially:
const {startMonitoring, stopMonitoring} = require('performance-time-tracker');
const asyncFunction = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve('Response after 3 seconds');
}, 3000);
});
};
startMonitoring('myFunction'); //give lable (in string) of your function so you can identify
await asyncFunction();
stopMonitoring();
const asyncFunction2 = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve('Response after 2.5 seconds');
}, 2500);
});
};
startMonitoring('response time of myFunction2'); //give lable (in string) of your function so you can identify
await asyncFunction2();
stopMonitoring();
//result
//Execution started for "myFunction".
//[1] [myFunction] - Execution Time: 3000.00 ms
//Execution started for "response time of myFunction2".
//[2] [response time of myFunction2] - Execution Time: 2500.00 ms
performance-time-tracker is released under the MIT License. Copyright (c) 2025 @sumitLKpatel
FAQs
A Node.js package for performance time tracking of functions or scripts
The npm package performance-time-tracker receives a total of 15 weekly downloads. As such, performance-time-tracker popularity was classified as not popular.
We found that performance-time-tracker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.