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

present

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

present

High-res timestamps in Node and browser

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
95K
increased by8.83%
Maintainers
1
Weekly downloads
 
Created
Source

present

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 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

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

Package last updated on 04 May 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