Paint Timing Metrics that is available during page load
https://www.w3.org/TR/paint-timing/
434480
function getPaintTimingMarks() {
  var paints = {}
  var perf = window.performance
  if (perf.getEntriesByType) {
    var entries = perf.getEntriesByType('paint')
    if (entries.length > 0) {
      var timings = perf.timing
      /**
       * To avoid capturing the unload event handler effect in paint timings
       */
      var unloadDiff = timings.fetchStart - timings.navigationStart
      for (var i = 0; i < entries.length; i++) {
        var data = entries[i]
        var calcPaintTime =
          unloadDiff >= 0 ? data.startTime - unloadDiff : data.startTime
        paints[data.name] = calcPaintTime
      }
    }
  }
  return paints
}
411473
private Paint getSliderTrackBorderColors() {
        switch (state) {

        case BACKGROUND_DISABLED:
            return getTextBorderPaint(CommonControlState.DISABLED,false);

        case BACKGROUND_ENABLED:
            return getTextBorderPaint(CommonControlState.ENABLED,false);
        }

        return null;
    }
372813
function ProgressBarPreloadScene (opts) {
    ProgressBarPreloadScene.superclass.constructor.call(this, opts)
    var size = Director.sharedDirector.winSize

    // Setup 'please wait' label
    var label = new Label({
        fontSize: 14,
        fontName: 'Helvetica',
        fontColor: '#ffffff',
        string: 'Please wait...'
    })
    label.position = new geo.Point(size.width / 2, (size.height / 2) + 32)
    this.label = label
    this.addChild({child: label})

    // Preloader for the progress bar assets
    var loadingPreloader = new Preloader([this.emptyImage, this.fullImage])

    // When progress bar resources have loaded then draw them and load all the rest
    events.addListener(loadingPreloader, 'complete', function (preloader) {
        this.createProgressBar()
        this.load()
    }.bind(this))

    loadingPreloader.load()
}
1315871
function(text) {

    if (vars.draw.timing) {
      text
        .transition().duration(vars.draw.timing)
        .attr("opacity",0)
        .remove();
    }
    else {
      text.remove();
    }

  }
742696
function onPagerendered(obj) {
        cache[obj.url] = {
            resource: obj.resource,
            time: Date.now()
        };

        //page render end
        trigger('onpagerendercomplete',{
            url : obj.url
        });
    }
149711
def on_redraw_timer(self, event):
        ''''''
        state = self.state
        while state.in_queue.qsize():
            try:
                obj = state.in_queue.get()
            except Exception:
                time.sleep(0.05)
                return
            if isinstance(obj, MPImageData):
                with warnings.catch_warnings():
                    warnings.simplefilter('ignore')
                    img = wx.EmptyImage(obj.width, obj.height)
                img.SetData(obj.data)
                self.img = img
                self.need_redraw = True
                if state.auto_size:
                    client_area = state.frame.GetClientSize()
                    total_area = state.frame.GetSize()
                    bx = max(total_area.x - client_area.x,0)
                    by = max(total_area.y - client_area.y,0)
                    state.frame.SetSize(wx.Size(obj.width+bx, obj.height+by))
            if isinstance(obj, MPImageTitle):
                state.frame.SetTitle(obj.title)
            if isinstance(obj, MPImageRecenter):
                self.on_recenter(obj.location)
            if isinstance(obj, MPImageMenu):
                self.set_menu(obj.menu)
            if isinstance(obj, MPImagePopupMenu):
                self.set_popup_menu(obj.menu)
            if isinstance(obj, MPImageBrightness):
                state.brightness = obj.brightness
                self.need_redraw = True
            if isinstance(obj, MPImageFullSize):
                self.full_size()
            if isinstance(obj, MPImageFitToWindow):
                self.fit_to_window()
            if isinstance(obj, win_layout.WinLayout):
                win_layout.set_wx_window_layout(state.frame, obj)
                
        if self.need_redraw:
            self.redraw()
922454
function(markName) {
			if (window.performance && window.performance.mark !== undefined) {
				window.performance.mark(markName);
			}
		}
702624
function (d, context) {
                    dimple._drawMarkers(d, chart, series, duration, className, graded, onEnter(d), onLeave(d), context);
                }
376209
function(url, callback) {
    var link = document.createElement('link');
    link.type = 'text/css';
    link.rel = 'stylesheet';
    if (useOnload)
      link.onload = function() {
        link.onload = function() {};
        // for style dimensions queries, a short delay can still be necessary
        setTimeout(callback, 7);
      }
    else
      var loadInterval = setInterval(function() {
        for (var i = 0; i < document.styleSheets.length; i++) {
          var sheet = document.styleSheets[i];
          if (sheet.href == link.href) {
            clearInterval(loadInterval);
            return callback();
          }
        }
      }, 10);
    link.href = url;
    head.appendChild(link);
  }
1129576
function (text, color, x, y, width) {
                        ctx.fillStyle = color;
                        var metric = ctx.measureText(text);
                        if (metric.width > width) {
                            while (text !== "") {
                                metric = ctx.measureText(text + "...");
                                if (metric.width <= width) {
                                    text += "...";
                                    break;
                                }
                                text = text.substr(0, text.length - 1);
                            }
                        }
                        ctx.fillText(text, x, y, width);
                    }
1363374
private void initializePainters() {
        mClockwiseReachedArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mClockwiseReachedArcPaint.setColor(mClockwiseArcColor);
        mClockwiseReachedArcPaint.setAntiAlias(true);
        mClockwiseReachedArcPaint.setStrokeWidth(mClockwiseReachedArcWidth);
        mClockwiseReachedArcPaint.setStyle(Paint.Style.STROKE);

        mCounterClockwiseReachedArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mCounterClockwiseReachedArcPaint.setColor(mCounterClockwiseArcColor);
        mCounterClockwiseReachedArcPaint.setAntiAlias(true);
        mCounterClockwiseReachedArcPaint.setStrokeWidth(mCounterClockwiseReachedArcWidth);
        mCounterClockwiseReachedArcPaint.setStyle(Paint.Style.STROKE);

        mClockwiseOutlineArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mClockwiseOutlineArcPaint.setColor(mClockwiseOutlineArcColor);
        mClockwiseOutlineArcPaint.setAntiAlias(true);
        mClockwiseOutlineArcPaint.setStrokeWidth(mClockwiseOutlineArcWidth);
        mClockwiseOutlineArcPaint.setStyle(Paint.Style.STROKE);

        mCounterClockwiseOutlineArcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mCounterClockwiseOutlineArcPaint.setColor(mCounterClockwiseOutlineArcColor);
        mCounterClockwiseOutlineArcPaint.setAntiAlias(true);
        mCounterClockwiseOutlineArcPaint.setStrokeWidth(mCounterClockwiseOutlineArcWidth);
        mCounterClockwiseOutlineArcPaint.setStyle(Paint.Style.STROKE);

        mCircleFillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mCircleFillPaint.setColor(mCircleFillColor);
        mCircleFillPaint.setAntiAlias(true);
        mCircleFillPaint.setStyle(Paint.Style.FILL);

        //Defaults
        mReachedArcPaint = mClockwiseReachedArcPaint;
        mOutlineArcPaint = mClockwiseOutlineArcPaint;
    }
1195640
function registerDraggingEventsOnCanvas(canvas) {
				
				//Mouse Drag Events for Desktop Version
				if (!isMobile()) {
					canvas.on('mousedown', function(event) {
						var x = event.pageX - $(this).offset().left;
						var y = event.pageY - $(this).offset().top;
						processTimeSelection(x, y);
						isDragging = true;
					});
					canvas.on('mouseup', function(event) {
						isDragging = false;
						var x = event.pageX - $(this).offset().left;
						var y = event.pageY - $(this).offset().top;
						var selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));
						if (settings.duration && settings.durationNegative && selectorLength <= 20) {
							var oldVal = inputElement.val();
							if (oldVal.match(/^-/)) {
								newVal = oldVal.substring(1);
							} else {
								newVal = '-' + oldVal.replace(/^(-|\+)/, '');
							}
							if (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) newVal = formatTime(settings.minimum);
							if (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) newVal = formatTime(settings.maximum);
							inputElement.val(formatTime(newVal));
							repaintClock();
							settings.onAdjust.call(element.get(0), newVal.replace(/^\+/, ''), oldVal.replace(/^\+/, ''));
							if (selectionMode == 'HOUR') selectHourOnInputElement();
							else selectMinuteOnInputElement();
							return;
						}
						if (!processTimeSelection(x, y, true)) {
							if (settings.precision == 60) {
								hideTimePicker();
							} else if (selectionMode == 'HOUR') {
								switchToMinuteMode();
								selectMinuteOnInputElement();
							} else {
								hideTimePicker();
							}
							return false;
						}
						if (selectionMode == 'MINUTE' || settings.precision == 60) {
							hideTimePicker();
						}
						else {
							switchToMinuteMode();
							selectMinuteOnInputElement();
						}
					});
					canvas.on('mousemove', function(event) {
						var x = event.pageX - $(this).offset().left;
						var y = event.pageY - $(this).offset().top;
						processTimeSelection(x, y);
					});
					canvas.on('mouseleave', function(event) {
						if (selectionMode == 'HOUR') repaintClockHourCanvas();
						else repaintClockMinuteCanvas();
					});
					
					canvas.on('mousewheel', function(event) {
						processMouseWheelEvent(event);
					});
				}
				
				//Touch Events for Mobile Version
				else {
					canvas.on('touchstart', function(event) {
						event.preventDefault();
						var x = event.originalEvent.touches[0].pageX - $(this).offset().left;
						var y = event.originalEvent.touches[0].pageY - $(this).offset().top;
						var selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));
						if (settings.duration && settings.durationNegative && selectorLength <= 20) {
							touchSignButton = true;
							var oldVal = inputElement.val();
							if (oldVal.match(/^-/)) {
								newVal = oldVal.substring(1);
							} else {
								newVal = '-' + oldVal.replace(/^(-|\+)/, '');
							}
							if (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) newVal = formatTime(settings.minimum);
							if (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) newVal = formatTime(settings.maximum);
							inputElement.val(formatTime(newVal));
							repaintClock();
							settings.onAdjust.call(element.get(0), newVal.replace(/^\+/, ''), oldVal.replace(/^\+/, ''));
							if (selectionMode == 'HOUR') selectHourOnInputElement();
							else selectMinuteOnInputElement();
							return;
						}
						processTimeSelection(x, y);
						isDragging = true;
					});
					canvas.on('touchend', function(event) {
						event.preventDefault();
						isDragging = false;
						if (!touchSignButton && settings.precision != 60) {
							switchToMinuteMode();
							selectMinuteOnInputElement();
						}
						touchSignButton = false;
					});
					canvas.on('touchmove', function(event) {
						event.preventDefault();
						if (isDragging) {
							var x = event.originalEvent.touches[0].pageX - $(this).offset().left;
							var y = event.originalEvent.touches[0].pageY - $(this).offset().top;
							processTimeSelection(x, y);
						}
					});
				}
				
				canvas.on('keydown', function(event) {
					event.preventDefault();
					processTimeSelection();
					switchToHourMode();
					selectHourOnInputElement();
					oldValue = inputElement.val();
				});
			}
107586
def metrics_graphic_for(data, options = {})
      @data              = data
      json_data          = data.to_json
      @target            = options.fetch(:target)
      @x_accessor        = options.fetch(:x_accessor)  { :date }
      @y_accessor        = options.fetch(:y_accessor)  { :value }
      title              = options.fetch(:title)
      description        = options.fetch(:description) { '' }
      width              = options.fetch(:width)       { 600 }
      height             = options.fetch(:height)      { 250 }
      @time_format       = options.fetch(:time_format) { '%Y-%m-%d' }
      @is_multiple       = data.first.is_a?(Array)
      @extra_options     = options[:extra_options] || {}

      javascript_tag <<-SCRIPT
var data = #{json_data};
#{convert_data_js}
MG.data_graphic({
  title: "#{title}",
  description: "#{description}",
  data: data,
  width: #{width},
  height: #{height},
  target: '#{@target}',#{extra_options_to_options}
  x_accessor: '#{@x_accessor}',
  y_accessor: '#{@y_accessor}'
});
SCRIPT
    end
769701
function() {
		var sprites = this.sprites,
		    background = this.background;

		if ( this.inRenderScanline ) {
			if ( this.enabled ) {
				background.evaluate();
				sprites.evaluate();
			}

			if ( this.pixelInRange ) {
				if ( 
					this.pixelInRange &&
					sprites.sprite0InRange &&
					sprites.scanlineSprite0[ this.lineCycle - 1 ] &&
					!this.sprite0Hit
				) {
					this.sprite0Hit = !!background.scanlineColors[ this.lineCycle - 1 ];
				}
			}

			this.incrementRenderCycle();
		} else {
			this.incrementIdleCycle();
		}
	}
200942
function renderCLI ({ url, status, time, size }) {
  return logUpdate(boxen(
    `${chalk.bgBlue.black(' HEML ')}\n\n` +
    `- ${chalk.bold('Preview:')}         ${url}\n` +
    `- ${chalk.bold('Status:')}          ${status}\n` +
    `- ${chalk.bold('Compile time:')}    ${time}ms\n` +
    `- ${chalk.bold('Total size:')}      ${size}`,
    { padding: 1, margin: 1 }))
}
1302931
function(rendererHelper) {
      if (!rendererHelper || !rendererHelper.compositorThread)
        return;

      var compositorThread = rendererHelper.compositorThread;
      var gestureScrollUpdateStart = this.start;
      var gestureScrollUpdateEnd = this.end;

      var allCompositorAsyncSlices =
        compositorThread.asyncSliceGroup.slices;

      for (var i in allCompositorAsyncSlices) {
        var slice = allCompositorAsyncSlices[i];

        if (slice.title !== 'Latency::ScrollUpdate')
          continue;

        var parentId = slice.args.data.
            INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT.
            sequence_number;

        if (parentId === undefined) {
          // Old trace, we can only rely on the timestamp to find the slice
          if (slice.start < gestureScrollUpdateStart ||
              slice.start >= gestureScrollUpdateEnd)
            continue;
        } else {
          // New trace, we can definitively find the latency slice by comparing
          // its sequence number with gesture id
          if (parseInt(parentId) !== parseInt(this.id))
            continue;
        }

        slice.associatedEvents.forEach(function(event) {
          this.associatedEvents_.push(event);
        }, this);
        break;
      }
    }
521947
def paintEvent(self, event):
        """"""
        super(AutoParameterTableView, self).paintEvent(event)

        if self.dragline is not None:
            pen = QtGui.QPen(QtCore.Qt.blue)
            painter = QtGui.QPainter(self.viewport())
            painter.setPen(pen)
            painter.drawLine(self.dragline)