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

microtime

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microtime

Get the current time in microseconds

  • 3.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
144K
increased by0.81%
Maintainers
1
Weekly downloads
 
Created

What is microtime?

The microtime package provides high-resolution time in microseconds, which is useful for performance measurement and benchmarking in Node.js applications.

What are microtime's main functionalities?

Get current time in microseconds

This feature allows you to get the current time in microseconds since the Unix epoch. It is useful for precise time measurements.

const microtime = require('microtime');
const currentTime = microtime.now();
console.log(currentTime);

Get current time as an array

This feature returns the current time as an array with two elements: seconds and microseconds. It provides a structured way to access high-resolution time.

const microtime = require('microtime');
const timeArray = microtime.nowStruct();
console.log(timeArray);

Get current time as a double

This feature returns the current time as a floating-point number representing seconds and fractions of a second. It is useful for calculations that require time in seconds.

const microtime = require('microtime');
const timeDouble = microtime.nowDouble();
console.log(timeDouble);

Other packages similar to microtime

Keywords

FAQs

Package last updated on 12 Aug 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