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

pretty-time

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-time

Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
905K
decreased by-17.29%
Maintainers
2
Weekly downloads
 
Created

What is pretty-time?

The pretty-time npm package is designed to format and display time durations in a human-readable format. It is particularly useful for converting raw time measurements in milliseconds into a more digestible format, which can be helpful in logging, monitoring, or displaying elapsed time in applications.

What are pretty-time's main functionalities?

Convert milliseconds to human-readable format

This feature allows developers to measure the duration of operations and display it in a format that is easy to read. The example shows how to use pretty-time to measure the time taken by an operation and print it in a human-readable format.

const prettyTime = require('pretty-time');

// Start a timer
const start = process.hrtime();

// Perform some operations...

// End the timer
const end = process.hrtime(start);

// Convert process time to a human-readable string
console.log('Operation took: ' + prettyTime(end));

Other packages similar to pretty-time

Keywords

FAQs

Package last updated on 12 Jul 2018

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