Skip to content

Simple performance now polyfill for old browsers and node

License

Notifications You must be signed in to change notification settings

yefremov/performancenow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

performancenow

npm version Build Status

Simple performance.now() polyfill for old browsers and node.

Installation

$ npm install performancenow

API

Make sure to import performancenow module in your application entrypoint, it will make a time stamp to measure against on every subsequent call.

import 'performancenow';

Then just import as a usual module wherever you need it.

import now from 'performancenow';

let timestamp = now();
// => 15.02

To polyfill performance.now() function.

(function (global) {
  global.performance = global.performance || {};
  global.performance.now = global.performance.now || require('performancenow');
}).call(this);

Running tests

$ npm test

License

MIT

About

Simple performance now polyfill for old browsers and node

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published