src/service/performance-impl.js
/**
   * Ticks a timing event.
   *
   * @param {string} label The variable name as it will be reported.
   *     See TICKEVENTS.md for available metrics, and edit this file
   *     when adding a new metric.
   * @param {number=} opt_delta The delta. Call tickDelta instead of setting
   *     this directly.
   */
Ticks a timing event.
@param {string} label The variable name as it will be reported.
See TICKEVENTS.md for available metrics, and edit this file
when adding a new metric.
@param {number=} opt_delta The delta. Call tickDelta instead of setting
this directly.
Ticks a timing event . @param { string } label The variable name as it will be reported . See TICKEVENTS . md for available metrics and edit this file when adding a new metric . @param { number = } opt_delta The delta . Call tickDelta instead of setting this directly .
tick(label, opt_delta) {
    const value = (opt_delta == undefined) ? this.win.Date.now() : undefined;
    const data = dict({
      'label': label,
      'value': value,
      'delta': opt_delta != null ? Math.max(opt_delta, 0) : undefined,
    });
    if (this.isMessagingReady_ && this.isPerformanceTrackingOn_) {
      this.viewer_.sendMessage('tick', data);
    } else {
      this.queueTick_(data);
    }
    if (this.win.performance
        && this.win.performance.mark
        && arguments.length == 1) {
      this.win.performance.mark(label);
    }
  }
tick ( label , opt_delta ) { const value = ( opt_delta == undefined ) ? this . win . Date . now ( ) : undefined ; const data = dict ( { 'label' : label , 'value' : value , 'delta' : opt_delta != null ? Math . max ( opt_delta , 0 ) : undefined , } ) ; if ( this . isMessagingReady_ && this . isPerformanceTrackingOn_ ) { this . viewer_ . sendMessage ( 'tick' , data ) ; } else { this . queueTick_ ( data ) ; } if ( this . win . performance && this . win . performance . mark && arguments . length == 1 ) { this . win . performance . mark ( label ) ; } }
Ticks a timing event.
Ticks a timing event .
// Delta can negative, but will always be changed to 0. // Add browser performance timeline entries for simple ticks. // These are for example exposed in WPT.