@financial-times/o-ads
Version:
This package contains the core functionality used by the FT in providing ads across all of its sites. This includes ft.com, howtospendit.com, ftadviser.com and other specialist titles.
31 lines (24 loc) • 652 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getEntriesByName = exports.getEntriesByType = exports.mark = void 0;
const perfmarks = [];
const mark = markName => {
perfmarks.push({
type: 'mark',
name: markName,
startTime: new Date().getMilliseconds()
});
};
exports.mark = mark;
const getEntriesByType = type => {
const marks = perfmarks.filter(m => m.type === type);
return marks;
};
exports.getEntriesByType = getEntriesByType;
const getEntriesByName = name => {
const marks = perfmarks.filter(m => m.name === name);
return marks;
};
exports.getEntriesByName = getEntriesByName;