Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marky

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marky

Performance timer based on performance.mark() and measure()

  • 1.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8M
increased by2.85%
Maintainers
1
Weekly downloads
 
Created

What is marky?

The marky npm package is a high-resolution JavaScript stopwatch that can be used to measure the duration of operations. It provides an easy-to-use API for starting, stopping, and getting elapsed time with high precision.

What are marky's main functionalities?

Start and stop a timer

This feature allows you to start a timer with a unique name and then stop it later to get the elapsed time.

const marky = require('marky');

marky.mark('myTimer');
// ... some operation ...
const myTimerResult = marky.stop('myTimer');
console.log('Elapsed time:', myTimerResult.duration);

Get a list of all timers

This feature allows you to retrieve a list of all timers that have been created and stopped, including their names and durations.

const marky = require('marky');

marky.mark('timer1');
// ... some operation ...
marky.stop('timer1');

marky.mark('timer2');
// ... another operation ...
marky.stop('timer2');

const allTimers = marky.getEntries();
console.log(allTimers);

Clear all timers

This feature allows you to clear all recorded timers from marky's internal storage.

const marky = require('marky');

marky.mark('timer1');
// ... some operation ...
marky.stop('timer1');

marky.clear();
const allTimersAfterClear = marky.getEntries();
console.log(allTimersAfterClear); // Should be an empty array

Other packages similar to marky

Keywords

FAQs

Package last updated on 04 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc