* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
9 lines
227 B
TypeScript
9 lines
227 B
TypeScript
export function bench<T>(fn: () => T, label = 'bench'): T {
|
|
const d = performance.now();
|
|
const r = fn();
|
|
const dd = performance.now();
|
|
// eslint-disable-next-line no-console
|
|
console.info(label, dd - d);
|
|
return r;
|
|
}
|