Simple performance.now()
polyfill for old browsers and node.
$ npm install performancenow
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);
$ npm test