Socket
Socket
Sign inDemoInstall

present

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    present

High-res timestamps in Node and browser


Version published
Maintainers
1
Install size
10.9 kB
Created

Readme

Source

present present on npm build status

High-res timestamps in Node and browser

Installation

In Node: npm install present

In browser:

  1. Copy present.js or present.min.js (with optional source map at present.min.js.map)
  2. <script src="path/to/present.{min.}js"></script>
  3. performance.now is automatically polyfilled -- if this is undesired, present.noConflict();

Usage

Node only: var present = require('present');

present()

Returns a timestamp in milliseconds. In node, this uses process.hrtime. In the browser, the following are attempted (in order):

  • performance.now()
  • performance.webkitNow()
  • performance.msNow()
  • performance.mozNow()
  • performance.oNow()
  • Date.now()
  • new Date().getTime()

present.noConflict()

Browser only. Resets performance.now to what it was before present was included or present.conflict was called.

present.conflict()

Browser only. Polyfills performance.now.

Keywords

FAQs

Last updated on 12 Apr 2016

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