Define a timer with User Timing

Capture performance data with a timing mark or a timing range in a page based on existing User Timing API methods.

The User Timing API is only available in a few browsers, such as modern versions of Internet Explorer and Chrome. It allows you to capture performance data between the value of performance marks and the value of performance measures. It’s similar in concept to using JavaScript timing points, but a much simpler way to add points without having to expose or add substantial amounts of additional JavaScript to your site.

How to

  1. Define either a timing mark (performance.mark) to capture a specific timing point in a page or a timing measure (performance.measure) to capture a range of time in a page. For an example of how a performance.mark is defined in a script, see User Timing.
  2. If the timer that you want to capture applies only to certain pages on your site, enter the URL pattern to match those pages.
    You can use an asterisk as a wildcard to replace one or more characters (for example, */example/example-abc/*). mPulse looks for the first matching query string parameter for the page that has a URL pattern match.
    Note: For the best results, avoid using a regular expression in the URL pattern.
  3. In the User Time Name field, enter the name of the timing mark or the timing measure that you defined in your source code. mPulse automatically detects the difference between performance marks and measures. It assumes that you want to know the time from the beginning of the page load until the timer itself is found on the page.