Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
timer-function-execution
Advanced tools
Measures function execution time. Supports synchronous and asynchronous functions.
Timer Function Execution is a library that provides a simple way to measure the execution time of functions in JavaScript and React Native. It supports both synchronous and asynchronous functions, making it a versatile tool for developers who want to optimize their code's performance.
You can install the library using npm or yarn:
$ npm install timer-function-execution
or
$ yarn add timer-function-execution
import Timer from "timer-function-execution";
const timer = new Timer();
// Measure the execution time of a synchronous function
timer.start();
simulateSyncOperation();
timer.stop();
console.log(
`Elapsed time for synchronous function: ${timer.getElapsedTime()} ms`
);
// Measure the execution time of an asynchronous function
await timer.measureAsync(async () => {
// Replace this with your asynchronous function
await simulateAsyncOperation();
});
This library is open-source and available under the MIT License.
Created by gusbdev
FAQs
Measures function execution time. Supports synchronous and asynchronous functions.
The npm package timer-function-execution receives a total of 6 weekly downloads. As such, timer-function-execution popularity was classified as not popular.
We found that timer-function-execution demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.