@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.
20 lines (16 loc) • 395 B
JavaScript
const perfmarks = [];
export const mark = markName => {
perfmarks.push({
type: 'mark',
name: markName,
startTime: new Date().getMilliseconds()
});
};
export const getEntriesByType = type => {
const marks = perfmarks.filter( m => m.type === type );
return marks;
};
export const getEntriesByName = name => {
const marks = perfmarks.filter( m => m.name === name );
return marks;
};