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

right-now

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

right-now

Get the quickest, most high-resolution timestamp possible in node or the browser

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
200K
increased by8.14%
Maintainers
1
Weekly downloads
 
Created
Source

right-now stable

Get the quickest, most high-resolution timestamp possible in node or the browser.

Instead of returning the date, right-now may use performance.now, Date.now, +new Date or process.hrtime to get a timestamp suitable for measuring intervals of time. Handy for both animation loops and precision benchmarking.

It's pretty small but saves me writing this boilerplate every time :)

Installation

npm install right-now

Usage

require('right-now')()

Returns a timestamp. In node, this uses process.hrtime. In the browser, support for the following is checked in this order:

  • performance.now()
  • Date.now()
  • +new Date

Keywords

FAQs

Package last updated on 09 Jun 2014

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