* Tick time delta since the document has become visible. * @param {TickLabel_Enum} label The variable name as it will be reported. * @param {number=} opt_delta The optional delta value in milliseconds.
(label, opt_delta)
| 860 | * @param {number=} opt_delta The optional delta value in milliseconds. |
| 861 | */ |
| 862 | tickSinceVisible(label, opt_delta) { |
| 863 | const delta = |
| 864 | opt_delta == undefined ? this.win.performance.now() : opt_delta; |
| 865 | const end = this.timeOrigin_ + delta; |
| 866 | |
| 867 | // If on Origin, use timeOrigin |
| 868 | // If in a viewer, use firstVisibleTime |
| 869 | const visibleTime = this.viewer_?.isEmbedded() |
| 870 | ? this.ampdoc_?.getFirstVisibleTime() |
| 871 | : this.timeOrigin_; |
| 872 | const v = visibleTime ? Math.max(end - visibleTime, 0) : 0; |
| 873 | this.tickDelta(label, v); |
| 874 | } |
| 875 | |
| 876 | /** |
| 877 | * Ask the viewer to flush the ticks |
no test coverage detected