Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 974265 of PerformanceResourceTiming

  • Revision slug: Web/API/PerformanceResourceTiming
  • Revision title: PerformanceResourceTiming
  • Revision id: 974265
  • Created:
  • Creator: AFBarstow
  • Is current revision? No
  • Comment Clarify the properties information.

Revision Content

{{APIRef("Resource Timing API")}}

The PerformanceResourceTiming interface enables retrieving and analyzing detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource such as an {{domxref("XMLHttpRequest")}}, {{SVGElement("SVG","SVG element")}}, image, script, etc.).

The {{domxref("PerformanceEntry","performance entry")}} properties extended by this interface create a resource loading timeline with {{domxref("DOMHighResTimeStamp","high resolution timestamps")}} for network events such as redirect start and end times, fetch start, DNS lookup start and end times, response start and end times, etc. Additionally, the interface extends {{domxref("PerformanceEntry","performance entries")}} with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.

The PerformanceResourceTiming interface has no properties, no methods nor any constructors. However, it extends the {{domxref("PerformanceEntry")}} interface with several properties (listed in the {{domxref("PerformanceEntry")}} reference).
PerformanceResourceTiming also extends the following {{domxref("PerformanceEntry","PerformanceEntry")}} properties: {{domxref("PerformanceEntry.name","name")}}, {{domxref("PerformanceEntry.entryType","entryType")}}, {{domxref("PerformanceEntry.startTime","startTime")}} and {{domxref("PerformanceEntry.duration","duration")}} with additional constraints/qualifications for "resource" {{domxref("PerformanceEntry.entryType","performance entry types")}}.

Properties

This interface has no properties but it extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constrainting the properties as follows:

{{domxref("PerformanceEntry.entryType","entryType")}}
Set to "resource".
{{domxref("PerformanceEntry.name","name")}}
Set to the resource's URL.
{{domxref("PerformanceEntry.startTime","startTime")}}
Set to the {{domxref("DOMHighResTimeStamp","timestamp")}} immediately before the browser to {{domxref("PerformanceEntry.fetchStart","fetch the resource")}}.
{{domxref("PerformanceEntry.duration","duration")}}
Set to the difference between the resource's {{domxref("PerformanceEntry.responseEnd","responseEnd")}} {{domxref("DOMHighResTimeStamp","timestamp")}} and its {{domxref("PerformanceEntry.startTime","startTime")}} {{domxref("DOMHighResTimeStamp","timestamp")}}.

Methods

This interface has no methods. It extends the {{domxref("PerformanceEntry.toJson","PerformanceEntry.toJSON()")}} method with additional constraints/qualifications for "resource" {{domxref("PerformanceEntry.entryType","performance entry types")}}.

Example

See the example in Using the Resource Timing API.

Specifications

Specification Status Comment
{{SpecName('Resource Timing', '#performanceresourcetiming', 'PerformanceResourceTiming')}} {{Spec2('Resource Timing')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support. 43 40 10 32 {{CompatNo}}
Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support. 4.4 42 {{CompatUnknown}} 10.0 32 {{CompatNo}}

See also

Revision Source

<div>{{APIRef("Resource Timing API")}}</div>

<p>The <strong><code>PerformanceResourceTiming</code></strong> interface enables retrieving and analyzing detailed network timing data regarding the loading of an application's <em>resources</em>. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource such as an {{domxref("XMLHttpRequest")}}, {{SVGElement("SVG","SVG element")}}, image, script, etc.).</p>

<p>The {{domxref("PerformanceEntry","performance entry")}} properties extended by this interface create a <em>resource loading timeline</em> with {{domxref("DOMHighResTimeStamp","high resolution timestamps")}} for network events such as redirect start and end times, fetch start, DNS lookup start and end times, response start and end times, etc. Additionally, the interface extends {{domxref("PerformanceEntry","performance entries")}} with other properties which provide data about the size of the fetched resource as well as the <em>type</em> of resource that initiated the fetch.</p>

<p class="note">The <code>PerformanceResourceTiming</code> interface has no properties, no methods nor any constructors. However, it extends the {{domxref("PerformanceEntry")}} interface with several properties (listed in the {{domxref("PerformanceEntry")}} reference).<br />
 <code>PerformanceResourceTiming</code> also extends the following {{domxref("PerformanceEntry","PerformanceEntry")}} properties: {{domxref("PerformanceEntry.name","name")}}, {{domxref("PerformanceEntry.entryType","entryType")}}, {{domxref("PerformanceEntry.startTime","startTime")}} and {{domxref("PerformanceEntry.duration","duration")}} with additional constraints/qualifications for "<code>resource</code>" {{domxref("PerformanceEntry.entryType","performance entry types")}}.</p>

<h2 id="Properties">Properties</h2>

<p>This interface has no properties but it extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constrainting the properties as follows:</p>

<dl>
 <dt>{{domxref("PerformanceEntry.entryType","entryType")}}</dt>
 <dd>Set to "<code>resource</code>".</dd>
 <dt>{{domxref("PerformanceEntry.name","name")}}</dt>
 <dd>Set to the resource's URL.</dd>
 <dt>{{domxref("PerformanceEntry.startTime","startTime")}}</dt>
 <dd>Set to the {{domxref("DOMHighResTimeStamp","timestamp")}} immediately before the browser to {{domxref("PerformanceEntry.fetchStart","fetch the resource")}}.</dd>
 <dt>{{domxref("PerformanceEntry.duration","duration")}}</dt
 <dd>Set to the difference between the resource's {{domxref("PerformanceEntry.responseEnd","responseEnd")}} {{domxref("DOMHighResTimeStamp","timestamp")}} and its {{domxref("PerformanceEntry.startTime","startTime")}} {{domxref("DOMHighResTimeStamp","timestamp")}}.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p>This interface has no methods. It extends the {{domxref("PerformanceEntry.toJson","PerformanceEntry.toJSON()")}} method with additional constraints/qualifications for "<code>resource</code>" {{domxref("PerformanceEntry.entryType","performance entry types")}}.</p>

<h2 id="Example">Example</h2>

<p>See the example in <a href="/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API">Using the Resource Timing API</a>.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Resource Timing', '#performanceresourcetiming', 'PerformanceResourceTiming')}}</td>
   <td>{{Spec2('Resource Timing')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support.</td>
   <td>43</td>
   <td>40</td>
   <td>10</td>
   <td>32</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support.</td>
   <td>4.4</td>
   <td>42</td>
   <td>{{CompatUnknown}}</td>
   <td>10.0</td>
   <td>32</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("PerformanceEntry")}}</li>
 <li><a href="/Web/API/Resource_Timing">Resource Timing (Overview)</a></li>
 <li><a href="/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API">Using the Resource Timing API</a></li>
</ul>
Revert to this revision