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

msecjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msecjs

Get the current time in microseconds

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

mSecjs

mSecjs is a Node.js module providing high-precision timing functions. This module is particularly useful in environments where microsecond-level time measurement is required.

Installation

You can install mSecjs:

npm install mSecjs

or 

pnpm install mSecjs

or 

yarn add mSecjs

Then, run the installation script defined in package.json:


npm run install

or

pnpm run install

or

yarn install

After installation, run the rebuild script:

npm run rebuild
or
pnpm run rebuild
or
yarn rebuild

Usage

Here are some examples of how to use mSecjs in your project:

const mSecjs = require('mSecjs');

// Get the current time in microseconds
let now = mSecjs.now();
console.log(now);

// Get the current time as a double
let nowDouble = mSecjs.nowDouble();
console.log(nowDouble);

// Get the current time as an array [seconds, microseconds]
let nowStruct = mSecjs.nowStruct();
console.log(nowStruct);

API

mSecjs exposes the following functions:

  • now(): Returns the current time in microseconds.
  • nowDouble(): Returns the current time as a double value.
  • nowStruct(): Returns the current time as an array containing seconds and microseconds.

Building

This module uses node-gyp for building. Ensure you have the necessary tools for compiling Node.js native modules.

Contributions

Contributions are welcome. Please send your pull requests to this repository.

License

MIT

Keywords

FAQs

Package last updated on 23 Dec 2023

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