function profiled(fn) {
  return function () {
    let start = Number(new Date());
    let retVal = fn.apply(this, arguments);
    let durationMs = Number(new Date()) - start;
    log(fn.name + ': ' + (durationMs > 1000 ? `${(durationMs / 1000).toFixed(2)}s` : durationMs + 'ms'));
    return retVal;
  };
}
/**
 * Decorator-style function that returns a new function that logs the duration of each
 * call to it.
 */
Decorator-style function that returns a new function that logs the duration of each
call to it.
Decorator - style function that returns a new function that logs the duration of each call to it .
function profiled(fn) {
  return function () {
    let start = Number(new Date());
    let retVal = fn.apply(this, arguments);
    let durationMs = Number(new Date()) - start;
    log(fn.name + ': ' + (durationMs > 1000 ? `${(durationMs / 1000).toFixed(2)}s` : durationMs + 'ms'));
    return retVal;
  };
}
function profiled ( fn ) { return function ( ) { let start = Number ( new Date ( ) ) ; let retVal = fn . apply ( this , arguments ) ; let durationMs = Number ( new Date ( ) ) - start ; log ( fn . name + ': ' + ( durationMs > 1000 ? ` ${ ( durationMs / 1000 ) . toFixed ( 2 ) } ` : durationMs + 'ms' ) ) ; return retVal ; } ; }
Decorator-style function that returns a new function that logs the duration of each
 call to it.
Decorator - style function that returns a new function that logs the duration of each call to it .