UNPKG

perf-marks

Version:

The simplest and lightweight solution for User Timing API in Javascript.

14 lines (13 loc) 506 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var is_user_timing_api_supported_1 = require("./is-user-timing-api-supported"); var getEntriesByType = function (entryName) { if (!is_user_timing_api_supported_1.isUserTimingAPISupported) { return []; } return performance.getEntriesByType(entryName) || []; }; var getNavigationMarker = function () { return getEntriesByType('navigation').pop() || {}; }; exports.getNavigationMarker = getNavigationMarker;