1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
---
title: PerformanceResourceTiming.connectEnd
slug: Web/API/PerformanceResourceTiming/connectEnd
tags:
- API
- Property
- Propriété
- Reference
- Performance Web
- Resource Timing API
- connectEnd
translation_of: Web/API/PerformanceResourceTiming/connectEnd
---
<div>{{APIRef("Resource Timing API")}}</div>
<p class="summary">La propriété en lecture seule <strong><code>connectEnd</code></strong> renvoie le <a href="/fr/docs/Web/API/DOMHighResTimeStamp"><code>timestamp</code></a> de l'instant suivant immédiatement la fin d'établissement de la connexion du navigateur au serveur pour récupérer la ressource. La valeur de l'horodatage comprend l'intervalle de temps pour établir la connexion de transport, ainsi que d'autres intervalles de temps tels que la poignée de main TLS/SSL et l'authentification SOCKS.</p>
<p>{{AvailableInWorkers}}</p>
<h2 id="Syntax">Syntaxe</h2>
<pre class="brush: js"><var>resource</var>.connectEnd;</pre>
<h3 id="Return_Value">Valeur de retour</h3>
<p>Un <a href="/fr/docs/Web/API/DOMHighResTimeStamp"><code>DOMHighResTimeStamp</code></a> représentant le temps après l'établissement d'une connexion.</p>
<h2 id="Example">Exemple</h2>
<p>Dans l'exemple suivant, la valeur des propriétés <code>*Start</code> et <code>*End</code> de tous les événements de <a href="/fr/docs/Web/API/PerformanceEntry/entryType">type</a> <code>"resource"</code> sont consignés.</p>
<pre class="brush: js">function print_PerformanceEntries() {
// Utilise getEntriesByType() pour obtenir uniquement les événements "resource"
let p = performance.getEntriesByType("resource");
for (let i = 0; i < p.length; i++) {
print_start_and_end_properties(p[i]);
}
}
function print_start_and_end_properties(perfEntry) {
// Imprime les horodatages des propriétés *start et *end
properties = ["connectStart", "connectEnd",
"domainLookupStart", "domainLookupEnd",
"fetchStart",
"redirectStart", "redirectEnd",
"requestStart",
"responseStart", "responseEnd",
"secureConnectionStart"];
for (let i = 0; i < properties.length; i++) {
// vérifie chaque propriété
let supported = properties[i] in perfEntry;
if (supported) {
let value = perfEntry[properties[i]];
console.log("... " + properties[i] + " = " + value);
} else {
console.log("... " + properties[i] + " = N'EST PAS pris en charge");
}
}
}
</pre>
<h2 id="Specifications">Spécifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Spécification</th>
<th scope="col">Statut</th>
<th scope="col">Commentaire</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('Resource Timing', '#dom-performanceresourcetiming-connectend',
'connectEnd')}}</td>
<td>{{Spec2('Resource Timing')}}</td>
<td>Définition initiale.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Compatibilité des navigateurs</h2>
<p>{{Compat("api.PerformanceResourceTiming.connectEnd")}}</p>
|