perf-marks
Version:
The simplest and lightweight solution for User Timing API in Javascript.
14 lines (13 loc) • 498 B
JavaScript
/**
* Boolean with the result of the check if User Timing API
* is supported for the current browser/NodeJS version
*
* @returns boolean
*
*/
var isUserTimingAPISupported = typeof performance !== 'undefined' &&
typeof performance.now !== 'undefined' &&
typeof performance.mark === 'function' &&
typeof performance.measure === 'function' &&
(typeof performance.clearMarks === 'function' || typeof performance.clearMeasures === 'function');
export { isUserTimingAPISupported };