Performance Plus
This is a utility and convenience library for the browser-based performance API, with support for IE8+ and zero dependencies.
The performance API allows for sub-millisecond, high-resolution timestamp measurements. This library adds some basic statistical helpers while collecting that data in slightly better style. In browsers below Internet Explorer 10, the performance API is unsupported. This library pseudo-fills that hole with plain old objects to deliver the same interface, just not at sub-millisecond resolution.
Example Usage
; var action = 'foobar';perfstartaction; // capture start timestamp; // this thing takes some timeperf; // capture ending timestamp// repeat the above loop a few times console;
// It can also measure FPS renderingperf; // measure and call every 2 seconds
Installation
$ npm install performance-plus
Methods
Commonly used methods:
perf; // high-res timestampperfstart'something';perf;perf; // in msperf; // in msperf; // in msperf; // all measures for this nameperf; // last measure for this name