npm

Need private packages and team management tools?Check out npm Orgs. »

right-now

1.0.0 • Public • Published

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

install

npm i right-now

Downloadsweekly downloads

59,768

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability