Socket
Socket
Sign inDemoInstall

right-now

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
188K
decreased by-4.02%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 09 Jun 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc