From 0830c11eef8ef87dda77d8274abb3c15297bc2b3 Mon Sep 17 00:00:00 2001 From: tristantheb Date: Tue, 16 Mar 2021 06:48:45 +0100 Subject: Complete French translation of the Performance interface (#163) * UPDATE: Update the content of the Performance page * CREATE: Translate the performance.clearMarks() page * CREATE: Translate the performance.clearMeasures() page * CREATE: Translate the performance.clearResourceTiming() page * CREATE: Translate the performance.getEntries() page * FIX: Tags not updated during the translation phase * CREATE: Translate the performance.getEntriesByName() page * CREATE: Translate the performance.getEntriesByType() page * CREATE: Translate the performance.mark() page * CREATE: Translate the performance.measure() page * CREATE: Translate the performance.memory page * CREATE: Translate the performance.onresourcetimingbufferfull page * CREATE: Translate the performance.onresourcetimingbufferfull_event page * CREATE: Translate the performance.setResourceTimingBufferSize() page * CREATE: Translate the performance.timeOrigin page * CREATE: Translate the performance.timing page * CREATE: Translate the performance.toJSON() page * UPDATE: Update content of the performance.navigation page * UPDATE: Update content of the performance.now() page * FIX: Fix several typo and style issues * Minor typofixes for #163 (1/n) * Minor typofixes for #163 (2/n) * Minor typofixes for #163 (3/n) * Minor modifications for #163 (4/n) * Minor typofixes for #163 (5/n) * Minor typofixes for #163 (6/n) * Minor typofixes for #163 (7/n) * Minor typofixes for #163 (8/n) * Minor typofixes for #163 (9/n) * Minor changes for #163 (10/n) * Minor typofixes for #163 (10/n) * Minor typofixes for #163 (12/n) * Minor typofixes for #163 (13/n) * Minor typofixes for #163 (14/n) * Minor typofixes for #163 (15/n) * Minor typofixes for #163 (16/n) * Minor typofixes for #163 (n/n) Co-authored-by: SphinxKnight --- files/fr/web/api/performance/getentries/index.html | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 files/fr/web/api/performance/getentries/index.html (limited to 'files/fr/web/api/performance/getentries') diff --git a/files/fr/web/api/performance/getentries/index.html b/files/fr/web/api/performance/getentries/index.html new file mode 100644 index 0000000000..2cebfda905 --- /dev/null +++ b/files/fr/web/api/performance/getentries/index.html @@ -0,0 +1,104 @@ +--- +title: performance.getEntries() +slug: Web/API/Performance/getEntries +tags: +- API +- Method +- Méthode +- Reference +- Performance web +translation_of: Web/API/Performance/getEntries +--- +
{{APIRef("Performance Timeline API")}}
+ +

La méthode getEntries() renvoie une liste de tous les objets {{domxref("PerformanceEntry")}} pour la page. Les membres de la liste (entrées) peuvent être créés en faisant des marqueurs ou des mesures de performance (par exemple en appelant la méthode {{domxref("Performance.mark", "mark()")}}) à des moments explicites. Si vous souhaitez filtrer les entrées de performance en fonction de leur type ou de leur nom, consultez la documentation des méthodes {{domxref("Performance.getEntriesByType", "getEntriesByType()")}} et {{domxref("Performance.getEntriesByName", "getEntriesByName()")}}.

+ +

{{AvailableInWorkers}}

+ +

Syntaxe

+ +
+  entries = window.performance.getEntries();
+
+ +

Valeur de retour

+ +
+
entries
+
Un tableau ({{jsxref("Array")}}) d'objets {{domxref("PerformanceEntry")}}. Les éléments seront classés par ordre chronologique en fonction des entrées {{domxref("PerformanceEntry.startTime","startTime")}}.
+
+ +

Exemple

+ +
function use_PerformanceEntry_methods() {
+  console.log("PerformanceEntry tests ...");
+
+  if (performance.mark === undefined) {
+    console.log("... performance.mark Non pris en charge");
+    return;
+  }
+
+  // Crée quelques entrées de performance via la méthode mark()
+  performance.mark("Begin");
+  do_work(50000);
+  performance.mark("End");
+  performance.mark("Begin");
+  do_work(100000);
+  performance.mark("End");
+  do_work(200000);
+  performance.mark("End");
+
+  // Utilise getEntries() pour itérer à travers chaque entrée.
+  let p = performance.getEntries();
+  for (var i=0; i < p.length; i++) {
+    console.log("Entry[" + i + "]");
+    check_PerformanceEntry(p[i]);
+  }
+
+  // Utilise getEntriesByType() pour obtenir toutes les entrées "mark".
+  p = performance.getEntriesByType("mark");
+  for (let i=0; i < p.length; i++) {
+    console.log ("Mark only entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+
+  // Utilise getEntriesByName() pour obtenir toutes les entrées "mark" nommées "Begin".
+  p = performance.getEntriesByName("Begin", "mark");
+  for (let i=0; i < p.length; i++) {
+    console.log ("Mark and Begin entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+}
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentries', + 'getEntries()')}}{{Spec2('Performance Timeline Level 2')}}
{{SpecName('Performance Timeline', '#dom-performance-getentries', + 'getEntries()')}}{{Spec2('Performance Timeline')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.Performance.getEntries")}}

-- cgit v1.2.3-54-g00ecf