From 96d2945591771f242a2e0dd50be77d5b2f872885 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 22 Feb 2022 01:14:08 +0900 Subject: Performance インターフェイスのメソッドの記事を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/performance/clearmarks/index.html | 92 ---------------- files/ja/web/api/performance/clearmarks/index.md | 92 ++++++++++++++++ .../web/api/performance/clearmeasures/index.html | 94 ----------------- .../ja/web/api/performance/clearmeasures/index.md | 94 +++++++++++++++++ .../performance/clearresourcetimings/index.html | 88 ---------------- .../api/performance/clearresourcetimings/index.md | 88 ++++++++++++++++ files/ja/web/api/performance/getentries/index.html | 102 ------------------ files/ja/web/api/performance/getentries/index.md | 102 ++++++++++++++++++ .../api/performance/getentriesbyname/index.html | 116 --------------------- .../web/api/performance/getentriesbyname/index.md | 116 +++++++++++++++++++++ .../api/performance/getentriesbytype/index.html | 114 -------------------- .../web/api/performance/getentriesbytype/index.md | 114 ++++++++++++++++++++ files/ja/web/api/performance/mark/index.html | 101 ------------------ files/ja/web/api/performance/mark/index.md | 101 ++++++++++++++++++ files/ja/web/api/performance/measure/index.html | 110 ------------------- files/ja/web/api/performance/measure/index.md | 110 +++++++++++++++++++ files/ja/web/api/performance/now/index.html | 103 ------------------ files/ja/web/api/performance/now/index.md | 103 ++++++++++++++++++ .../setresourcetimingbuffersize/index.html | 76 -------------- .../setresourcetimingbuffersize/index.md | 76 ++++++++++++++ files/ja/web/api/performance/tojson/index.html | 64 ------------ files/ja/web/api/performance/tojson/index.md | 64 ++++++++++++ 22 files changed, 1060 insertions(+), 1060 deletions(-) delete mode 100644 files/ja/web/api/performance/clearmarks/index.html create mode 100644 files/ja/web/api/performance/clearmarks/index.md delete mode 100644 files/ja/web/api/performance/clearmeasures/index.html create mode 100644 files/ja/web/api/performance/clearmeasures/index.md delete mode 100644 files/ja/web/api/performance/clearresourcetimings/index.html create mode 100644 files/ja/web/api/performance/clearresourcetimings/index.md delete mode 100644 files/ja/web/api/performance/getentries/index.html create mode 100644 files/ja/web/api/performance/getentries/index.md delete mode 100644 files/ja/web/api/performance/getentriesbyname/index.html create mode 100644 files/ja/web/api/performance/getentriesbyname/index.md delete mode 100644 files/ja/web/api/performance/getentriesbytype/index.html create mode 100644 files/ja/web/api/performance/getentriesbytype/index.md delete mode 100644 files/ja/web/api/performance/mark/index.html create mode 100644 files/ja/web/api/performance/mark/index.md delete mode 100644 files/ja/web/api/performance/measure/index.html create mode 100644 files/ja/web/api/performance/measure/index.md delete mode 100644 files/ja/web/api/performance/now/index.html create mode 100644 files/ja/web/api/performance/now/index.md delete mode 100644 files/ja/web/api/performance/setresourcetimingbuffersize/index.html create mode 100644 files/ja/web/api/performance/setresourcetimingbuffersize/index.md delete mode 100644 files/ja/web/api/performance/tojson/index.html create mode 100644 files/ja/web/api/performance/tojson/index.md (limited to 'files/ja') diff --git a/files/ja/web/api/performance/clearmarks/index.html b/files/ja/web/api/performance/clearmarks/index.html deleted file mode 100644 index 7cc3b260b5..0000000000 --- a/files/ja/web/api/performance/clearmarks/index.html +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: performance.clearMarks() -slug: Web/API/Performance/clearMarks -tags: - - API - - Web パフォーマンス - - メソッド -translation_of: Web/API/Performance/clearMarks ---- -
{{APIRef("User Timing API")}}
- -

clearMarks() メソッドは、ブラウザのパフォーマンスエントリバッファから名前付きマークを削除します。
- このメソッドが引数なしで呼び出された場合、{{domxref("PerformanceEntry.entryType","エントリタイプ")}} が "mark" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}}はすべてパフォーマンスエントリバッファから削除されます。

- -

{{AvailableInWorkers}}

- -

構文

- -
performance.clearMarks();
-performance.clearMarks(name);
-
- -

引数

- -
-
name {{optional_inline}}
-
タイムスタンプの名前を表す{{domxref("DOMString")}}。 この引数を省略すると、 {{domxref("PerformanceEntry.entryType","entry type")}} が "mark" であるすべての {{domxref("PerformanceEntry","performance entries")}} が削除されます。
-
- -

戻り値

- -
-
void
-
- -

- -

次の例は、clearMarks() メソッドの両方の使用法を示しています。

- -
// Create a small helper to show how many PerformanceMark entries there are.
-function logMarkCount() {
-  console.log(
-    "Found this many entries: " + performance.getEntriesByType("mark").length
-  );
-}
-
-// Create a bunch of marks.
-performance.mark("squirrel");
-performance.mark("squirrel");
-performance.mark("monkey");
-performance.mark("monkey");
-performance.mark("dog");
-performance.mark("dog");
-
-logMarkCount() // "Found this many entries: 6"
-
-// Delete just the "squirrel" PerformanceMark entries.
-performance.clearMarks('squirrel');
-logMarkCount() // "Found this many entries: 4"
-
-// Delete all of the PerformanceMark entries.
-performance.clearMarks();
-logMarkCount() // "Found this many entries: 0"
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-clearmarks', 'clearMarks()')}}{{Spec2('User Timing Level 2')}}clearMarks() を明確にします。
{{SpecName('User Timing', '#dom-performance-clearmarks', 'clearMarks()')}}{{Spec2('User Timing')}}基本的な定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/clearmarks/index.md b/files/ja/web/api/performance/clearmarks/index.md new file mode 100644 index 0000000000..7cc3b260b5 --- /dev/null +++ b/files/ja/web/api/performance/clearmarks/index.md @@ -0,0 +1,92 @@ +--- +title: performance.clearMarks() +slug: Web/API/Performance/clearMarks +tags: + - API + - Web パフォーマンス + - メソッド +translation_of: Web/API/Performance/clearMarks +--- +
{{APIRef("User Timing API")}}
+ +

clearMarks() メソッドは、ブラウザのパフォーマンスエントリバッファから名前付きマークを削除します。
+ このメソッドが引数なしで呼び出された場合、{{domxref("PerformanceEntry.entryType","エントリタイプ")}} が "mark" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}}はすべてパフォーマンスエントリバッファから削除されます。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
performance.clearMarks();
+performance.clearMarks(name);
+
+ +

引数

+ +
+
name {{optional_inline}}
+
タイムスタンプの名前を表す{{domxref("DOMString")}}。 この引数を省略すると、 {{domxref("PerformanceEntry.entryType","entry type")}} が "mark" であるすべての {{domxref("PerformanceEntry","performance entries")}} が削除されます。
+
+ +

戻り値

+ +
+
void
+
+ +

+ +

次の例は、clearMarks() メソッドの両方の使用法を示しています。

+ +
// Create a small helper to show how many PerformanceMark entries there are.
+function logMarkCount() {
+  console.log(
+    "Found this many entries: " + performance.getEntriesByType("mark").length
+  );
+}
+
+// Create a bunch of marks.
+performance.mark("squirrel");
+performance.mark("squirrel");
+performance.mark("monkey");
+performance.mark("monkey");
+performance.mark("dog");
+performance.mark("dog");
+
+logMarkCount() // "Found this many entries: 6"
+
+// Delete just the "squirrel" PerformanceMark entries.
+performance.clearMarks('squirrel');
+logMarkCount() // "Found this many entries: 4"
+
+// Delete all of the PerformanceMark entries.
+performance.clearMarks();
+logMarkCount() // "Found this many entries: 0"
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-clearmarks', 'clearMarks()')}}{{Spec2('User Timing Level 2')}}clearMarks() を明確にします。
{{SpecName('User Timing', '#dom-performance-clearmarks', 'clearMarks()')}}{{Spec2('User Timing')}}基本的な定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/clearmeasures/index.html b/files/ja/web/api/performance/clearmeasures/index.html deleted file mode 100644 index 7a1fa2b6af..0000000000 --- a/files/ja/web/api/performance/clearmeasures/index.html +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: performance.clearMeasures() -slug: Web/API/Performance/clearMeasures -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/clearMeasures ---- -
{{APIRef("User Timing API")}}
- -

clearMeasures() メソッドは、ブラウザのパフォーマンスエントリバッファから名前付きメジャーを削除します。
- メソッドが引数なしで呼び出された場合、エントリタイプが  "measure" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}} はすべてパフォーマンスエントリバッファから削除されます。

- -

{{AvailableInWorkers}}

- -

構文

- -
performance.clearMeasures();
-performance.clearMeasures(name);
-
- -

引数

- -
-
name {{optional_inline}}
-
タイムスタンプの名前を表す {{domxref("DOMString")}}。この引数を省略すると、{{domxref("PerformanceEntry.entryType","エントリタイプ")}}が  "measure" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}}がすべて削除されます。
-
- -

戻り値

- -
-
void
-
- -

- -

次の例は、clearMeasures() メソッドの両方の使用方法を示しています。

- -
// Create a small helper to show how many PerformanceMeasure entries there are.
-function logMeasureCount() {
-  console.log(
-    "Found this many entries: " + performance.getEntriesByType("measure").length
-  );
-}
-
-// Create a bunch of measures.
-performance.measure("from navigation");
-performance.mark("a");
-performance.measure("from mark a", "a");
-performance.measure("from navigation");
-performance.measure("from mark a", "a");
-performance.mark("b");
-performance.measure("between a and b", "a", "b");
-
-logMeasureCount() // "Found this many entries: 5"
-
-// Delete just the "from navigation" PerformanceMeasure entries.
-performance.clearMeasures("from navigation");
-logMeasureCount() // "Found this many entries: 3"
-
-// Delete all of the PerformanceMeasure entries.
-performance.clearMeasures();
-logMeasureCount() // "Found this many entries: 0"
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing Level 2')}}clearMeasures() を明確にします。
{{SpecName('User Timing', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing')}}基本的な定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/clearmeasures/index.md b/files/ja/web/api/performance/clearmeasures/index.md new file mode 100644 index 0000000000..7a1fa2b6af --- /dev/null +++ b/files/ja/web/api/performance/clearmeasures/index.md @@ -0,0 +1,94 @@ +--- +title: performance.clearMeasures() +slug: Web/API/Performance/clearMeasures +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/clearMeasures +--- +
{{APIRef("User Timing API")}}
+ +

clearMeasures() メソッドは、ブラウザのパフォーマンスエントリバッファから名前付きメジャーを削除します。
+ メソッドが引数なしで呼び出された場合、エントリタイプが  "measure" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}} はすべてパフォーマンスエントリバッファから削除されます。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
performance.clearMeasures();
+performance.clearMeasures(name);
+
+ +

引数

+ +
+
name {{optional_inline}}
+
タイムスタンプの名前を表す {{domxref("DOMString")}}。この引数を省略すると、{{domxref("PerformanceEntry.entryType","エントリタイプ")}}が  "measure" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}}がすべて削除されます。
+
+ +

戻り値

+ +
+
void
+
+ +

+ +

次の例は、clearMeasures() メソッドの両方の使用方法を示しています。

+ +
// Create a small helper to show how many PerformanceMeasure entries there are.
+function logMeasureCount() {
+  console.log(
+    "Found this many entries: " + performance.getEntriesByType("measure").length
+  );
+}
+
+// Create a bunch of measures.
+performance.measure("from navigation");
+performance.mark("a");
+performance.measure("from mark a", "a");
+performance.measure("from navigation");
+performance.measure("from mark a", "a");
+performance.mark("b");
+performance.measure("between a and b", "a", "b");
+
+logMeasureCount() // "Found this many entries: 5"
+
+// Delete just the "from navigation" PerformanceMeasure entries.
+performance.clearMeasures("from navigation");
+logMeasureCount() // "Found this many entries: 3"
+
+// Delete all of the PerformanceMeasure entries.
+performance.clearMeasures();
+logMeasureCount() // "Found this many entries: 0"
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing Level 2')}}clearMeasures() を明確にします。
{{SpecName('User Timing', '#dom-performance-clearmeasures', 'clearMeasures()')}}{{Spec2('User Timing')}}基本的な定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/clearresourcetimings/index.html b/files/ja/web/api/performance/clearresourcetimings/index.html deleted file mode 100644 index 62b46febce..0000000000 --- a/files/ja/web/api/performance/clearresourcetimings/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: performance.clearResourceTimings() -slug: Web/API/Performance/clearResourceTimings -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/clearResourceTimings ---- -
{{APIRef("Resource Timing API")}}
- -

clearResourceTimings() メソッドは、{{domxref("PerformanceEntry.entryType","entryType")}} が "resource" のすべての{{domxref("PerformanceEntry","パフォーマンスエントリ")}}をブラウザのパフォーマンスデータバッファから削除し、パフォーマンスデータバッファのサイズをゼロに設定します。ブラウザのパフォーマンスデータバッファのサイズを設定するには、{{domxref("Performance.setResourceTimingBufferSize()")}} メソッドを使用します。

- -

{{AvailableInWorkers}}

- -

構文

- -
performance.clearResourceTimings();
-
- -

引数

- -
-
void
-
 
-
- -

戻り値

- -
-
なし
-
このメソッドには戻り値はありません。
-
- -

- -
function load_resource() {
-  var image = new Image();
-  image.src = "https://developer.mozilla.org/static/img/opengraph-logo.png";
-}
-function clear_performance_timings() {
-  if (performance === undefined) {
-    log("Browser does not support Web Performance");
-    return;
-  }
-  // Create a resource timing performance entry by loading an image
-  load_resource();
-
-  var supported = typeof performance.clearResourceTimings == "function";
-  if (supported) {
-    console.log("Run: performance.clearResourceTimings()");
-    performance.clearResourceTimings();
-  } else {
-    console.log("performance.clearResourceTimings() NOT supported");
-    return;
-  }
-  // getEntries should now return zero
-  var p = performance.getEntriesByType("resource");
-  if (p.length == 0)
-    console.log("... Performance data buffer cleared");
-  else
-    console.log("... Performance data buffer NOT cleared!");
-}
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Resource Timing', '#dom-performance-clearresourcetimings', 'clearResourceTimings()')}}{{Spec2('Resource Timing')}}初期定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/clearresourcetimings/index.md b/files/ja/web/api/performance/clearresourcetimings/index.md new file mode 100644 index 0000000000..62b46febce --- /dev/null +++ b/files/ja/web/api/performance/clearresourcetimings/index.md @@ -0,0 +1,88 @@ +--- +title: performance.clearResourceTimings() +slug: Web/API/Performance/clearResourceTimings +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/clearResourceTimings +--- +
{{APIRef("Resource Timing API")}}
+ +

clearResourceTimings() メソッドは、{{domxref("PerformanceEntry.entryType","entryType")}} が "resource" のすべての{{domxref("PerformanceEntry","パフォーマンスエントリ")}}をブラウザのパフォーマンスデータバッファから削除し、パフォーマンスデータバッファのサイズをゼロに設定します。ブラウザのパフォーマンスデータバッファのサイズを設定するには、{{domxref("Performance.setResourceTimingBufferSize()")}} メソッドを使用します。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
performance.clearResourceTimings();
+
+ +

引数

+ +
+
void
+
 
+
+ +

戻り値

+ +
+
なし
+
このメソッドには戻り値はありません。
+
+ +

+ +
function load_resource() {
+  var image = new Image();
+  image.src = "https://developer.mozilla.org/static/img/opengraph-logo.png";
+}
+function clear_performance_timings() {
+  if (performance === undefined) {
+    log("Browser does not support Web Performance");
+    return;
+  }
+  // Create a resource timing performance entry by loading an image
+  load_resource();
+
+  var supported = typeof performance.clearResourceTimings == "function";
+  if (supported) {
+    console.log("Run: performance.clearResourceTimings()");
+    performance.clearResourceTimings();
+  } else {
+    console.log("performance.clearResourceTimings() NOT supported");
+    return;
+  }
+  // getEntries should now return zero
+  var p = performance.getEntriesByType("resource");
+  if (p.length == 0)
+    console.log("... Performance data buffer cleared");
+  else
+    console.log("... Performance data buffer NOT cleared!");
+}
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Resource Timing', '#dom-performance-clearresourcetimings', 'clearResourceTimings()')}}{{Spec2('Resource Timing')}}初期定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/getentries/index.html b/files/ja/web/api/performance/getentries/index.html deleted file mode 100644 index b8d0602839..0000000000 --- a/files/ja/web/api/performance/getentries/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: performance.getEntries() -slug: Web/API/Performance/getEntries -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/getEntries ---- -
{{APIRef("Performance Timeline API")}}
- -

getEntries() メソッドは、そのページのすべての {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。特定の種類のパフォーマンスエントリや特定の名前のパフォーマンスエントリにのみ関心がある場合は、{{domxref("Performance.getEntriesByType", "getEntriesByType()")}} と {{domxref("Performance.getEntriesByName", "getEntriesByName()")}} を参照してください。

- -

{{AvailableInWorkers}}

- -

構文

- -

一般的な構文:

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

戻り値

- -
-
entries
-
{{domxref("PerformanceEntry")}} オブジェクトの配列。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。
-
- -

- -
function use_PerformanceEntry_methods() {
-  console.log("PerformanceEntry tests ...");
-
-  if (performance.mark === undefined) {
-    console.log("... performance.mark Not supported");
-    return;
-  }
-
-  // Create some performance entries via the mark() method
-  performance.mark("Begin");
-  do_work(50000);
-  performance.mark("End");
-  performance.mark("Begin");
-  do_work(100000);
-  performance.mark("End");
-  do_work(200000);
-  performance.mark("End");
-
-  // Use getEntries() to iterate through the each entry
-  let p = performance.getEntries();
-  for (var i=0; i < p.length; i++) {
-    console.log("Entry[" + i + "]");
-    check_PerformanceEntry(p[i]);
-  }
-
-  // Use getEntriesByType() to get all "mark" entries
-  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);
-  }
-
-  // Use getEntriesByName() to get all "mark" entries named "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);
-  }
-}
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentries', 'getEntries()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentries', 'getEntries()')}}{{Spec2('Performance Timeline')}}初期定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/getentries/index.md b/files/ja/web/api/performance/getentries/index.md new file mode 100644 index 0000000000..b8d0602839 --- /dev/null +++ b/files/ja/web/api/performance/getentries/index.md @@ -0,0 +1,102 @@ +--- +title: performance.getEntries() +slug: Web/API/Performance/getEntries +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/getEntries +--- +
{{APIRef("Performance Timeline API")}}
+ +

getEntries() メソッドは、そのページのすべての {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。特定の種類のパフォーマンスエントリや特定の名前のパフォーマンスエントリにのみ関心がある場合は、{{domxref("Performance.getEntriesByType", "getEntriesByType()")}} と {{domxref("Performance.getEntriesByName", "getEntriesByName()")}} を参照してください。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +

一般的な構文:

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

戻り値

+ +
+
entries
+
{{domxref("PerformanceEntry")}} オブジェクトの配列。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。
+
+ +

+ +
function use_PerformanceEntry_methods() {
+  console.log("PerformanceEntry tests ...");
+
+  if (performance.mark === undefined) {
+    console.log("... performance.mark Not supported");
+    return;
+  }
+
+  // Create some performance entries via the mark() method
+  performance.mark("Begin");
+  do_work(50000);
+  performance.mark("End");
+  performance.mark("Begin");
+  do_work(100000);
+  performance.mark("End");
+  do_work(200000);
+  performance.mark("End");
+
+  // Use getEntries() to iterate through the each entry
+  let p = performance.getEntries();
+  for (var i=0; i < p.length; i++) {
+    console.log("Entry[" + i + "]");
+    check_PerformanceEntry(p[i]);
+  }
+
+  // Use getEntriesByType() to get all "mark" entries
+  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);
+  }
+
+  // Use getEntriesByName() to get all "mark" entries named "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);
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentries', 'getEntries()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentries', 'getEntries()')}}{{Spec2('Performance Timeline')}}初期定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/getentriesbyname/index.html b/files/ja/web/api/performance/getentriesbyname/index.html deleted file mode 100644 index 6678a8f984..0000000000 --- a/files/ja/web/api/performance/getentriesbyname/index.html +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: performance.getEntriesByName() -slug: Web/API/Performance/getEntriesByName -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/getEntriesByName ---- -
{{APIRef("Performance Timeline API")}}
- -

getEntriesByName() メソッドは、指定された名前タイプの {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。

- -

{{AvailableInWorkers}}

- -

構文

- -
entries = window.performance.getEntriesByName(name, type);
-
- -

引数

- -
-
name
-
取得するエントリの名前
-
type {{optional_inline}}
-
"mark" など、取得するエントリの種類。有効なエントリタイプは {{domxref("PerformanceEntry.entryType")}} に一覧表示されています。
-
- -

戻り値

- -
-
entries
-
指定された nametype を持つ {{domxref("PerformanceEntry")}} オブジェクトのリスト。 type 引数が指定されていない場合は、返されるエントリを決定するために名前だけが使用されます。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。指定された基準を満たすオブジェクトがない場合は、空のリストが返されます。
-
- -

- -
function use_PerformanceEntry_methods() {
-  log("PerformanceEntry tests ...");
-
-  if (performance.mark === undefined) {
-    log("... performance.mark Not supported");
-    return;
-  }
-
-  // Create some performance entries via the mark() method
-  performance.mark("Begin");
-  do_work(50000);
-  performance.mark("End");
-  performance.mark("Begin");
-  do_work(100000);
-  performance.mark("End");
-  do_work(200000);
-  performance.mark("End");
-
-  // Use getEntries() to iterate through the each entry
-  var p = performance.getEntries();
-  for (var i=0; i < p.length; i++) {
-    log("Entry[" + i + "]");
-    check_PerformanceEntry(p[i]);
-  }
-
-  // Use getEntries(name, entryType) to get specific entries
-  p = performance.getEntries({name : "Begin", entryType: "mark"});
-  for (var i=0; i < p.length; i++) {
-    log("Begin[" + i + "]");
-    check_PerformanceEntry(p[i]);
-  }
-
-  // Use getEntriesByType() to get all "mark" entries
-  p = performance.getEntriesByType("mark");
-  for (var i=0; i < p.length; i++) {
-    log ("Mark only entry[" + i + "]: name = " + p[i].name +
-         "; startTime = " + p[i].startTime +
-         "; duration  = " + p[i].duration);
-  }
-
-  // Use getEntriesByName() to get all "mark" entries named "Begin"
-  p = performance.getEntriesByName("Begin", "mark");
-  for (var i=0; i < p.length; i++) {
-    log ("Mark and Begin entry[" + i + "]: name = " + p[i].name +
-         "; startTime = " + p[i].startTime +
-         "; duration  = " + p[i].duration);
-  }
-}
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentriesbyname', 'getEntriesByName()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentriesbyname', 'getEntriesByName()')}}{{Spec2('Performance Timeline')}}初期定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/getentriesbyname/index.md b/files/ja/web/api/performance/getentriesbyname/index.md new file mode 100644 index 0000000000..6678a8f984 --- /dev/null +++ b/files/ja/web/api/performance/getentriesbyname/index.md @@ -0,0 +1,116 @@ +--- +title: performance.getEntriesByName() +slug: Web/API/Performance/getEntriesByName +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/getEntriesByName +--- +
{{APIRef("Performance Timeline API")}}
+ +

getEntriesByName() メソッドは、指定された名前タイプの {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
entries = window.performance.getEntriesByName(name, type);
+
+ +

引数

+ +
+
name
+
取得するエントリの名前
+
type {{optional_inline}}
+
"mark" など、取得するエントリの種類。有効なエントリタイプは {{domxref("PerformanceEntry.entryType")}} に一覧表示されています。
+
+ +

戻り値

+ +
+
entries
+
指定された nametype を持つ {{domxref("PerformanceEntry")}} オブジェクトのリスト。 type 引数が指定されていない場合は、返されるエントリを決定するために名前だけが使用されます。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。指定された基準を満たすオブジェクトがない場合は、空のリストが返されます。
+
+ +

+ +
function use_PerformanceEntry_methods() {
+  log("PerformanceEntry tests ...");
+
+  if (performance.mark === undefined) {
+    log("... performance.mark Not supported");
+    return;
+  }
+
+  // Create some performance entries via the mark() method
+  performance.mark("Begin");
+  do_work(50000);
+  performance.mark("End");
+  performance.mark("Begin");
+  do_work(100000);
+  performance.mark("End");
+  do_work(200000);
+  performance.mark("End");
+
+  // Use getEntries() to iterate through the each entry
+  var p = performance.getEntries();
+  for (var i=0; i < p.length; i++) {
+    log("Entry[" + i + "]");
+    check_PerformanceEntry(p[i]);
+  }
+
+  // Use getEntries(name, entryType) to get specific entries
+  p = performance.getEntries({name : "Begin", entryType: "mark"});
+  for (var i=0; i < p.length; i++) {
+    log("Begin[" + i + "]");
+    check_PerformanceEntry(p[i]);
+  }
+
+  // Use getEntriesByType() to get all "mark" entries
+  p = performance.getEntriesByType("mark");
+  for (var i=0; i < p.length; i++) {
+    log ("Mark only entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+
+  // Use getEntriesByName() to get all "mark" entries named "Begin"
+  p = performance.getEntriesByName("Begin", "mark");
+  for (var i=0; i < p.length; i++) {
+    log ("Mark and Begin entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentriesbyname', 'getEntriesByName()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentriesbyname', 'getEntriesByName()')}}{{Spec2('Performance Timeline')}}初期定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/getentriesbytype/index.html b/files/ja/web/api/performance/getentriesbytype/index.html deleted file mode 100644 index 7244ff580b..0000000000 --- a/files/ja/web/api/performance/getentriesbytype/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: performance.getEntriesByType() -slug: Web/API/Performance/getEntriesByType -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/getEntriesByType ---- -
{{APIRef("Performance Timeline API")}}
- -

getEntriesByType() メソッドは、指定された型の {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。

- -

{{AvailableInWorkers}}

- -

構文

- -
entries = window.performance.getEntriesByType(type);
-
- -

引数

- -
-
type
-
"mark" など、取得するエントリの種類。有効なエントリタイプは {{domxref("PerformanceEntry.entryType")}} に一覧表示されています。
-
- -

戻り値

- -
-
entries
-
指定された type を持つ {{domxref("PerformanceEntry")}} オブジェクトのリスト。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。指定された type を持つオブジェクトがない場合、または引数が指定されていない場合は、空のリストが返されます。
-
- -

- -
function usePerformanceEntryMethods() {
-  log("PerformanceEntry tests ...");
-
-  if (performance.mark === undefined) {
-    log("... performance.mark Not supported");
-    return;
-  }
-
-  // Create some performance entries via the mark() method
-  performance.mark("Begin");
-  doWork(50000);
-  performance.mark("End");
-  performance.mark("Begin");
-  doWork(100000);
-  performance.mark("End");
-  doWork(200000);
-  performance.mark("End");
-
-  // Use getEntries() to iterate through the each entry
-  var p = performance.getEntries();
-  for (var i=0; i < p.length; i++) {
-    log("Entry[" + i + "]");
-    checkPerformanceEntry(p[i]);
-  }
-
-  // Use getEntries(name, entryType) to get specific entries
-  p = performance.getEntries({name : "Begin", entryType: "mark"});
-  for (var i=0; i < p.length; i++) {
-    log("Begin[" + i + "]");
-    checkPerformanceEntry(p[i]);
-  }
-
-  // Use getEntriesByType() to get all "mark" entries
-  p = performance.getEntriesByType("mark");
-  for (var i=0; i < p.length; i++) {
-    log ("Mark only entry[" + i + "]: name = " + p[i].name +
-         "; startTime = " + p[i].startTime +
-         "; duration  = " + p[i].duration);
-  }
-
-  // Use getEntriesByName() to get all "mark" entries named "Begin"
-  p = performance.getEntriesByName("Begin", "mark");
-  for (var i=0; i < p.length; i++) {
-    log ("Mark and Begin entry[" + i + "]: name = " + p[i].name +
-         "; startTime = " + p[i].startTime +
-         "; duration  = " + p[i].duration);
-  }
-}
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentriesbytype', 'getEntriesByType()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentriesbytype', 'getEntriesByType()')}}{{Spec2('Performance Timeline')}}初期定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/getentriesbytype/index.md b/files/ja/web/api/performance/getentriesbytype/index.md new file mode 100644 index 0000000000..7244ff580b --- /dev/null +++ b/files/ja/web/api/performance/getentriesbytype/index.md @@ -0,0 +1,114 @@ +--- +title: performance.getEntriesByType() +slug: Web/API/Performance/getEntriesByType +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/getEntriesByType +--- +
{{APIRef("Performance Timeline API")}}
+ +

getEntriesByType() メソッドは、指定された型の {{domxref("PerformanceEntry")}} オブジェクトのリストを返します。リストのメンバ (エントリ) は、明示的な時点でパフォーマンスマークまたはメジャーを作成することで (たとえば {{domxref("Performance.mark","mark()")}} メソッドを呼び出すことで) 作成できます。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
entries = window.performance.getEntriesByType(type);
+
+ +

引数

+ +
+
type
+
"mark" など、取得するエントリの種類。有効なエントリタイプは {{domxref("PerformanceEntry.entryType")}} に一覧表示されています。
+
+ +

戻り値

+ +
+
entries
+
指定された type を持つ {{domxref("PerformanceEntry")}} オブジェクトのリスト。項目はエントリ '{{domxref("PerformanceEntry.startTime","startTime")}} に基づいて時系列に並んでいます。指定された type を持つオブジェクトがない場合、または引数が指定されていない場合は、空のリストが返されます。
+
+ +

+ +
function usePerformanceEntryMethods() {
+  log("PerformanceEntry tests ...");
+
+  if (performance.mark === undefined) {
+    log("... performance.mark Not supported");
+    return;
+  }
+
+  // Create some performance entries via the mark() method
+  performance.mark("Begin");
+  doWork(50000);
+  performance.mark("End");
+  performance.mark("Begin");
+  doWork(100000);
+  performance.mark("End");
+  doWork(200000);
+  performance.mark("End");
+
+  // Use getEntries() to iterate through the each entry
+  var p = performance.getEntries();
+  for (var i=0; i < p.length; i++) {
+    log("Entry[" + i + "]");
+    checkPerformanceEntry(p[i]);
+  }
+
+  // Use getEntries(name, entryType) to get specific entries
+  p = performance.getEntries({name : "Begin", entryType: "mark"});
+  for (var i=0; i < p.length; i++) {
+    log("Begin[" + i + "]");
+    checkPerformanceEntry(p[i]);
+  }
+
+  // Use getEntriesByType() to get all "mark" entries
+  p = performance.getEntriesByType("mark");
+  for (var i=0; i < p.length; i++) {
+    log ("Mark only entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+
+  // Use getEntriesByName() to get all "mark" entries named "Begin"
+  p = performance.getEntriesByName("Begin", "mark");
+  for (var i=0; i < p.length; i++) {
+    log ("Mark and Begin entry[" + i + "]: name = " + p[i].name +
+         "; startTime = " + p[i].startTime +
+         "; duration  = " + p[i].duration);
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performance-getentriesbytype', 'getEntriesByType()')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performance-getentriesbytype', 'getEntriesByType()')}}{{Spec2('Performance Timeline')}}初期定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/mark/index.html b/files/ja/web/api/performance/mark/index.html deleted file mode 100644 index 1a02bd4154..0000000000 --- a/files/ja/web/api/performance/mark/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: performance.mark() -slug: Web/API/Performance/mark -tags: - - API - - Webパフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/mark ---- -
{{APIRef("User Timing API")}}
- -

mark() メソッドは、ブラウザのパフォーマンスエントリバッファに、指定された名前で{{domxref("DOMHighResTimeStamp","timestamp")}} を作成します。アプリケーション定義のタイムスタンプは、{{domxref("Performance")}} インタフェースの getEntries*() メソッド ({{domxref("Performance.getEntries","getEntries()")}}、{{domxref("Performance.getEntriesByName","getEntriesByName()")}} または{{domxref("Performance.getEntriesByType","getEntriesByType()")}}) のいずれかによって取得できます。

- -

{{AvailableInWorkers}}

- -

mark の {{domxref("PerformanceEntry","performance entry")}} は、次のプロパティ値を持ちます。

- - - -

このメソッドに与えられた name が {{domxref("PerformanceTiming")}} インターフェイスにすでに存在する場合、{{jsxref("SyntaxError")}} がスローされます。

- -

構文

- -
performance.mark(name);
-
- -

引数

- -
-
name
-
マークの名前を表す {{domxref("DOMString")}}。
-
- -

戻り値

- -
-
void
-
 
-
- -

- -

次の例は、mark() を使用して {{domxref("PerformanceMark")}} エントリを作成および取得する方法を示しています。

- -
// たくさんの mark を作成します。
-performance.mark("squirrel");
-performance.mark("squirrel");
-performance.mark("monkey");
-performance.mark("monkey");
-performance.mark("dog");
-performance.mark("dog");
-
-// PerformanceMark エントリをすべて取得します。
-const allEntries = performance.getEntriesByType("mark");
-console.log(allEntries.length);
-// 6
-
-// "monkey" PerformanceMark エントリをすべて入手します。
-const monkeyEntries = performance.getEntriesByName("monkey");
-console.log(monkeyEntries.length);
-// 2
-
-// すべての mark を消去します。
-performance.clearMarks();
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-mark', 'mark()')}}{{Spec2('User Timing Level 2')}} -

mark() 処理モデルを明確にします。

-
{{SpecName('User Timing', '#dom-performance-mark', 'mark()')}}{{Spec2('User Timing')}}基本的な定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/mark/index.md b/files/ja/web/api/performance/mark/index.md new file mode 100644 index 0000000000..1a02bd4154 --- /dev/null +++ b/files/ja/web/api/performance/mark/index.md @@ -0,0 +1,101 @@ +--- +title: performance.mark() +slug: Web/API/Performance/mark +tags: + - API + - Webパフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/mark +--- +
{{APIRef("User Timing API")}}
+ +

mark() メソッドは、ブラウザのパフォーマンスエントリバッファに、指定された名前で{{domxref("DOMHighResTimeStamp","timestamp")}} を作成します。アプリケーション定義のタイムスタンプは、{{domxref("Performance")}} インタフェースの getEntries*() メソッド ({{domxref("Performance.getEntries","getEntries()")}}、{{domxref("Performance.getEntriesByName","getEntriesByName()")}} または{{domxref("Performance.getEntriesByType","getEntriesByType()")}}) のいずれかによって取得できます。

+ +

{{AvailableInWorkers}}

+ +

mark の {{domxref("PerformanceEntry","performance entry")}} は、次のプロパティ値を持ちます。

+ + + +

このメソッドに与えられた name が {{domxref("PerformanceTiming")}} インターフェイスにすでに存在する場合、{{jsxref("SyntaxError")}} がスローされます。

+ +

構文

+ +
performance.mark(name);
+
+ +

引数

+ +
+
name
+
マークの名前を表す {{domxref("DOMString")}}。
+
+ +

戻り値

+ +
+
void
+
 
+
+ +

+ +

次の例は、mark() を使用して {{domxref("PerformanceMark")}} エントリを作成および取得する方法を示しています。

+ +
// たくさんの mark を作成します。
+performance.mark("squirrel");
+performance.mark("squirrel");
+performance.mark("monkey");
+performance.mark("monkey");
+performance.mark("dog");
+performance.mark("dog");
+
+// PerformanceMark エントリをすべて取得します。
+const allEntries = performance.getEntriesByType("mark");
+console.log(allEntries.length);
+// 6
+
+// "monkey" PerformanceMark エントリをすべて入手します。
+const monkeyEntries = performance.getEntriesByName("monkey");
+console.log(monkeyEntries.length);
+// 2
+
+// すべての mark を消去します。
+performance.clearMarks();
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-mark', 'mark()')}}{{Spec2('User Timing Level 2')}} +

mark() 処理モデルを明確にします。

+
{{SpecName('User Timing', '#dom-performance-mark', 'mark()')}}{{Spec2('User Timing')}}基本的な定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/measure/index.html b/files/ja/web/api/performance/measure/index.html deleted file mode 100644 index d9a6e43bdd..0000000000 --- a/files/ja/web/api/performance/measure/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: performance.measure() -slug: Web/API/Performance/measure -tags: - - API - - Web Workers - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/measure ---- -
{{APIRef("User Timing API")}}
- -

measure() メソッドは、マーク間、ナビゲーション開始時刻、または現在時刻の間に、ブラウザのパフォーマンスエントリバッファに名前付き {{domxref("DOMHighResTimeStamp","timestamp")}} を作成します。2つのマーク間を測定するときは、それぞれ開始マーク終了マークがあります。名前付きタイムスタンプは、メジャーと呼ばれます。

- -

measure は、{{domxref("Performance")}} インターフェイスの1つで取得できます。({{domxref("Performance.getEntries","getEntries()")}}、{{domxref("Performance.getEntriesByName","getEntriesByName()")}}または{{domxref("Performance.getEntriesByType","getEntriesByType()")}})

- -

measure の {{domxref("PerformanceEntry","performance entry")}} は、次のプロパティ値を持ちます。

- - - -

{{AvailableInWorkers}}

- -

構文

- -
performance.measure(name);
-performance.measure(name, startMark);
-performance.measure(name, startMark, endMark);
-performance.measure(name, undefined, endMark);
-
- -

引数

- -
-
name
-
メジャーの名前を表す {{domxref("DOMString")}}。
-
startMark {{optional_inline}}
-
メジャーの開始マークの名前を表す {{domxref("DOMString")}}。{{domxref("PerformanceTiming")}} プロパティの名前になることもあります。省略した場合は、開始時間がナビゲーション開始時間になります。
-
endMark {{optional_inline}}
-
メジャーの終了マークの名前を表す {{domxref("DOMString")}}。{{domxref("PerformanceTiming")}} プロパティの名前になることもあります。省略した場合は、現在時刻が使用されます。
-
- -

戻り値

- -
-
void
-
 
-
- -

- -

次の例は、ブラウザのパフォーマンスエントリバッファに measure() を使用して新しいメジャー{{domxref("PerformanceEntry","パフォーマンスエントリ")}}を作成する方法を示しています。

- -
const markerNameA = "example-marker-a"
-const markerNameB = "example-marker-b"
-
-// いくつかのネストしたタイムアウトを実行し、それぞれに対して PerformanceMark を作成します。
-performance.mark(markerNameA);
-setTimeout(function() {
-  performance.mark(markerNameB);
-  setTimeout(function() {
-
-    // さまざまな測定値を作成します。
-    performance.measure("measure a to b", markerNameA, markerNameB);
-    performance.measure("measure a to now", markerNameA);
-    performance.measure("measure from navigation start to b", undefined, markerNameB);
-    performance.measure("measure from the start of navigation to now");
-
-    // すべての測定値を引き出します。
-    console.log(performance.getEntriesByType("measure"));
-
-    // 最後に、エントリを整理します。
-    performance.clearMarks();
-    performance.clearMeasures();
-  }, 1000);
-}, 1000);
-
- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-measure', 'measure()')}}{{Spec2('User Timing Level 2')}}measure() 処理モデルを明確にします。
{{SpecName('User Timing', '#dom-performance-measure', 'measure()')}}{{Spec2('User Timing')}}基本的な定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/measure/index.md b/files/ja/web/api/performance/measure/index.md new file mode 100644 index 0000000000..d9a6e43bdd --- /dev/null +++ b/files/ja/web/api/performance/measure/index.md @@ -0,0 +1,110 @@ +--- +title: performance.measure() +slug: Web/API/Performance/measure +tags: + - API + - Web Workers + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/measure +--- +
{{APIRef("User Timing API")}}
+ +

measure() メソッドは、マーク間、ナビゲーション開始時刻、または現在時刻の間に、ブラウザのパフォーマンスエントリバッファに名前付き {{domxref("DOMHighResTimeStamp","timestamp")}} を作成します。2つのマーク間を測定するときは、それぞれ開始マーク終了マークがあります。名前付きタイムスタンプは、メジャーと呼ばれます。

+ +

measure は、{{domxref("Performance")}} インターフェイスの1つで取得できます。({{domxref("Performance.getEntries","getEntries()")}}、{{domxref("Performance.getEntriesByName","getEntriesByName()")}}または{{domxref("Performance.getEntriesByType","getEntriesByType()")}})

+ +

measure の {{domxref("PerformanceEntry","performance entry")}} は、次のプロパティ値を持ちます。

+ + + +

{{AvailableInWorkers}}

+ +

構文

+ +
performance.measure(name);
+performance.measure(name, startMark);
+performance.measure(name, startMark, endMark);
+performance.measure(name, undefined, endMark);
+
+ +

引数

+ +
+
name
+
メジャーの名前を表す {{domxref("DOMString")}}。
+
startMark {{optional_inline}}
+
メジャーの開始マークの名前を表す {{domxref("DOMString")}}。{{domxref("PerformanceTiming")}} プロパティの名前になることもあります。省略した場合は、開始時間がナビゲーション開始時間になります。
+
endMark {{optional_inline}}
+
メジャーの終了マークの名前を表す {{domxref("DOMString")}}。{{domxref("PerformanceTiming")}} プロパティの名前になることもあります。省略した場合は、現在時刻が使用されます。
+
+ +

戻り値

+ +
+
void
+
 
+
+ +

+ +

次の例は、ブラウザのパフォーマンスエントリバッファに measure() を使用して新しいメジャー{{domxref("PerformanceEntry","パフォーマンスエントリ")}}を作成する方法を示しています。

+ +
const markerNameA = "example-marker-a"
+const markerNameB = "example-marker-b"
+
+// いくつかのネストしたタイムアウトを実行し、それぞれに対して PerformanceMark を作成します。
+performance.mark(markerNameA);
+setTimeout(function() {
+  performance.mark(markerNameB);
+  setTimeout(function() {
+
+    // さまざまな測定値を作成します。
+    performance.measure("measure a to b", markerNameA, markerNameB);
+    performance.measure("measure a to now", markerNameA);
+    performance.measure("measure from navigation start to b", undefined, markerNameB);
+    performance.measure("measure from the start of navigation to now");
+
+    // すべての測定値を引き出します。
+    console.log(performance.getEntriesByType("measure"));
+
+    // 最後に、エントリを整理します。
+    performance.clearMarks();
+    performance.clearMeasures();
+  }, 1000);
+}, 1000);
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('User Timing Level 2', '#dom-performance-measure', 'measure()')}}{{Spec2('User Timing Level 2')}}measure() 処理モデルを明確にします。
{{SpecName('User Timing', '#dom-performance-measure', 'measure()')}}{{Spec2('User Timing')}}基本的な定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/now/index.html b/files/ja/web/api/performance/now/index.html deleted file mode 100644 index 2c77a37538..0000000000 --- a/files/ja/web/api/performance/now/index.html +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: performance.now() -slug: Web/API/Performance/now -tags: - - API - - Method - - Performance - - Reference - - Web Performance API -translation_of: Web/API/Performance/now ---- -
{{APIRef("High Resolution Timing")}}
- -

performance.now() メソッドは、ミリ秒単位で計測された {{domxref("DOMHighResTimeStamp")}} を返します。

- -
-

タイムスタンプは実際には高解像度ではありません。Spectre のようなセキュリティ上の脅威を軽減するために、ブラウザは現在、さまざまな程度まで結果を丸めています (Firefox は Firefox 59 から 2 ミリ秒に丸めています)。ブラウザによっては、タイムスタンプを少しランダム化するものもあります。 精度は将来のリリースで改善されることでしょう。ブラウザの開発者は、これらのタイミング攻撃と、それを軽減する最善策について調査しています。

-
- -

{{AvailableInWorkers}}

- -

戻り値は、time origin からの経過時間を表します。

- -

次の点に留意してください:

- - - -

構文

- -
t = performance.now();
- -

- -
var t0 = performance.now();
-doSomething();
-var t1 = performance.now();
-console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.");
-
- -

JavaScript で利用できる他のタイミングデータ (例えば Date.now) とは違い、 performance.now() が返すタイムスタンプは、1ミリ秒の分解能に制限されません。その代わりに、マイクロ秒までの精度を持った浮動小数点の値で表します。

- -

また、Date.now() とは違い、performance.now() が返す値は、常に一定の割合で増加します。システムクロック (これはマニュアルで調整、またはNTPのようなソフトウェアで変えられているかもしれません) から独立しているのです。他方で performance.timing.navigationStart + performance.now() は、おおよそ Date.now() と同じになるでしょう。

- -

時間精度の引き下げ

- -

タイミング攻撃やフィンガープリンティングから保護するため、ブラウザの設定によっては、performance.now() の精度が丸められることがあります。
-Firefoxでは、privacy.reduceTimerPrecision の設定がデフォルトで有効になっており、Firefox 59 ではデフォルトで 20 us (マイクロ秒) に設定されています。 Firefox 60 では 2 ms (ミリ秒) になります。

- -
// Firefox 60 での時間精度の引き下げ (2ms)
-performance.now();
-// 8781416
-// 8781814
-// 8782206
-// ...
-
-
-// `privacy.resistFingerprinting` 有効化による時間精度の引き下げ`
-performance.now();
-// 8865400
-// 8866200
-// 8866700
-// ...
-
- -

Firefoxでは privacy.resistFingerprinting も有効にできます。これは、精度を 100 ms か privacy.resistFingerprinting.reduceTimerPrecision.microseconds のどちらか大きい方へ変更します。

- -

仕様

- - - - - - - - - - - - - - - - - - - -
仕様書策定状況コメント
{{SpecName('Highres Time Level 2', '#dom-performance-now', 'performance.now()')}}{{Spec2('Highres Time Level 2')}}インターフェイスと型について、より厳密な定義
{{SpecName('Highres Time', '#dom-performance-now', 'performance.now()')}}{{Spec2('Highres Time')}}初期定義
- -

ブラウザー実装状況

- - - -

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

- -

関連情報

- - diff --git a/files/ja/web/api/performance/now/index.md b/files/ja/web/api/performance/now/index.md new file mode 100644 index 0000000000..2c77a37538 --- /dev/null +++ b/files/ja/web/api/performance/now/index.md @@ -0,0 +1,103 @@ +--- +title: performance.now() +slug: Web/API/Performance/now +tags: + - API + - Method + - Performance + - Reference + - Web Performance API +translation_of: Web/API/Performance/now +--- +
{{APIRef("High Resolution Timing")}}
+ +

performance.now() メソッドは、ミリ秒単位で計測された {{domxref("DOMHighResTimeStamp")}} を返します。

+ +
+

タイムスタンプは実際には高解像度ではありません。Spectre のようなセキュリティ上の脅威を軽減するために、ブラウザは現在、さまざまな程度まで結果を丸めています (Firefox は Firefox 59 から 2 ミリ秒に丸めています)。ブラウザによっては、タイムスタンプを少しランダム化するものもあります。 精度は将来のリリースで改善されることでしょう。ブラウザの開発者は、これらのタイミング攻撃と、それを軽減する最善策について調査しています。

+
+ +

{{AvailableInWorkers}}

+ +

戻り値は、time origin からの経過時間を表します。

+ +

次の点に留意してください:

+ + + +

構文

+ +
t = performance.now();
+ +

+ +
var t0 = performance.now();
+doSomething();
+var t1 = performance.now();
+console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.");
+
+ +

JavaScript で利用できる他のタイミングデータ (例えば Date.now) とは違い、 performance.now() が返すタイムスタンプは、1ミリ秒の分解能に制限されません。その代わりに、マイクロ秒までの精度を持った浮動小数点の値で表します。

+ +

また、Date.now() とは違い、performance.now() が返す値は、常に一定の割合で増加します。システムクロック (これはマニュアルで調整、またはNTPのようなソフトウェアで変えられているかもしれません) から独立しているのです。他方で performance.timing.navigationStart + performance.now() は、おおよそ Date.now() と同じになるでしょう。

+ +

時間精度の引き下げ

+ +

タイミング攻撃やフィンガープリンティングから保護するため、ブラウザの設定によっては、performance.now() の精度が丸められることがあります。
+Firefoxでは、privacy.reduceTimerPrecision の設定がデフォルトで有効になっており、Firefox 59 ではデフォルトで 20 us (マイクロ秒) に設定されています。 Firefox 60 では 2 ms (ミリ秒) になります。

+ +
// Firefox 60 での時間精度の引き下げ (2ms)
+performance.now();
+// 8781416
+// 8781814
+// 8782206
+// ...
+
+
+// `privacy.resistFingerprinting` 有効化による時間精度の引き下げ`
+performance.now();
+// 8865400
+// 8866200
+// 8866700
+// ...
+
+ +

Firefoxでは privacy.resistFingerprinting も有効にできます。これは、精度を 100 ms か privacy.resistFingerprinting.reduceTimerPrecision.microseconds のどちらか大きい方へ変更します。

+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName('Highres Time Level 2', '#dom-performance-now', 'performance.now()')}}{{Spec2('Highres Time Level 2')}}インターフェイスと型について、より厳密な定義
{{SpecName('Highres Time', '#dom-performance-now', 'performance.now()')}}{{Spec2('Highres Time')}}初期定義
+ +

ブラウザー実装状況

+ + + +

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

+ +

関連情報

+ + diff --git a/files/ja/web/api/performance/setresourcetimingbuffersize/index.html b/files/ja/web/api/performance/setresourcetimingbuffersize/index.html deleted file mode 100644 index 3c8a46ce8a..0000000000 --- a/files/ja/web/api/performance/setresourcetimingbuffersize/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: performance.setResourceTimingBufferSize() -slug: Web/API/Performance/setResourceTimingBufferSize -tags: - - API - - Web パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/setResourceTimingBufferSize ---- -
{{APIRef("Resource Timing API")}}
- -

setResourceTimingBufferSize() メソッドは、ブラウザのリソースタイミングバッファサイズを、指定された数の "resource" {{domxref("PerformanceEntry.entryType","performance entry type")}} オブジェクトに設定します。

- -

ブラウザの推奨リソースタイミングバッファサイズは少なくとも 150 {{domxref("PerformanceEntry","performance entry")}} オブジェクトです。

- -

{{AvailableInWorkers}}

- -

構文

- -
performance.setResourceTimingBufferSize(maxSize);
-
- -

引数

- -
-
maxSize
-
ブラウザがパフォーマンスエントリバッファに保持する必要がある {{domxref("PerformanceEntry","performance entry")}} オブジェクトの最大数を表す number
-
- -

戻り値

- -
-
なし
-
このメソッドには戻り値はありません。
-
- -

- -
function setResourceTimingBufferSize(maxSize) {
-  if (performance === undefined) {
-    log("Browser does not support Web Performance");
-    return;
-  }
-  var supported = typeof performance.setResourceTimingBufferSize == "function";
-  if (supported) {
-    log("... Performance.setResourceTimingBufferSize() = Yes");
-    performance.setResourceTimingBufferSize(maxSize);
-  } else {
-    log("... Performance.setResourceTimingBufferSize() = NOT supported");
-  }
-}
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Resource Timing', '#dom-performance-setresourcetimingbuffersize', 'setResourceTimingBufferSize()')}}{{Spec2('Resource Timing')}}初期定義
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/setresourcetimingbuffersize/index.md b/files/ja/web/api/performance/setresourcetimingbuffersize/index.md new file mode 100644 index 0000000000..3c8a46ce8a --- /dev/null +++ b/files/ja/web/api/performance/setresourcetimingbuffersize/index.md @@ -0,0 +1,76 @@ +--- +title: performance.setResourceTimingBufferSize() +slug: Web/API/Performance/setResourceTimingBufferSize +tags: + - API + - Web パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/setResourceTimingBufferSize +--- +
{{APIRef("Resource Timing API")}}
+ +

setResourceTimingBufferSize() メソッドは、ブラウザのリソースタイミングバッファサイズを、指定された数の "resource" {{domxref("PerformanceEntry.entryType","performance entry type")}} オブジェクトに設定します。

+ +

ブラウザの推奨リソースタイミングバッファサイズは少なくとも 150 {{domxref("PerformanceEntry","performance entry")}} オブジェクトです。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
performance.setResourceTimingBufferSize(maxSize);
+
+ +

引数

+ +
+
maxSize
+
ブラウザがパフォーマンスエントリバッファに保持する必要がある {{domxref("PerformanceEntry","performance entry")}} オブジェクトの最大数を表す number
+
+ +

戻り値

+ +
+
なし
+
このメソッドには戻り値はありません。
+
+ +

+ +
function setResourceTimingBufferSize(maxSize) {
+  if (performance === undefined) {
+    log("Browser does not support Web Performance");
+    return;
+  }
+  var supported = typeof performance.setResourceTimingBufferSize == "function";
+  if (supported) {
+    log("... Performance.setResourceTimingBufferSize() = Yes");
+    performance.setResourceTimingBufferSize(maxSize);
+  } else {
+    log("... Performance.setResourceTimingBufferSize() = NOT supported");
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Resource Timing', '#dom-performance-setresourcetimingbuffersize', 'setResourceTimingBufferSize()')}}{{Spec2('Resource Timing')}}初期定義
+ +

ブラウザの互換性

+ +
+

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

+
diff --git a/files/ja/web/api/performance/tojson/index.html b/files/ja/web/api/performance/tojson/index.html deleted file mode 100644 index 16ed75efdc..0000000000 --- a/files/ja/web/api/performance/tojson/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: performance.toJSON() -slug: Web/API/Performance/toJSON -tags: - - API - - パフォーマンス - - メソッド - - リファレンス -translation_of: Web/API/Performance/toJSON ---- -
{{APIRef("High Resolution Timing")}}
- -

{{domxref("Performance")}} インターフェイスの toJSON() メソッドは標準のシリアライザです。パフォーマンスオブジェクトのプロパティの JSON 表現を返します。

- -

{{availableinworkers}}

- -

構文

- -
myPerf = performance.toJSON()
-
- -

引数

- -
-
なし
-
 
-
- -

戻り値

- -
-
myPerf
-
{{domxref("Performance")}} オブジェクトのシリアル化である JSON オブジェクト
-
- -

- -
var js;
-js = window.performance.toJSON();
-console.log("json = " + JSON.stringify(js));
-
- -

仕様

- - - - - - - - - - - - - - -
仕様書ステータスコメント
{{SpecName('Highres Time Level 2', '#dom-performance-tojson', 'toJSON() serializer')}}{{Spec2('Highres Time Level 2')}}toJson()を定義します。
- -

ブラウザの互換性

- -
-

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

-
diff --git a/files/ja/web/api/performance/tojson/index.md b/files/ja/web/api/performance/tojson/index.md new file mode 100644 index 0000000000..16ed75efdc --- /dev/null +++ b/files/ja/web/api/performance/tojson/index.md @@ -0,0 +1,64 @@ +--- +title: performance.toJSON() +slug: Web/API/Performance/toJSON +tags: + - API + - パフォーマンス + - メソッド + - リファレンス +translation_of: Web/API/Performance/toJSON +--- +
{{APIRef("High Resolution Timing")}}
+ +

{{domxref("Performance")}} インターフェイスの toJSON() メソッドは標準のシリアライザです。パフォーマンスオブジェクトのプロパティの JSON 表現を返します。

+ +

{{availableinworkers}}

+ +

構文

+ +
myPerf = performance.toJSON()
+
+ +

引数

+ +
+
なし
+
 
+
+ +

戻り値

+ +
+
myPerf
+
{{domxref("Performance")}} オブジェクトのシリアル化である JSON オブジェクト
+
+ +

+ +
var js;
+js = window.performance.toJSON();
+console.log("json = " + JSON.stringify(js));
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Highres Time Level 2', '#dom-performance-tojson', 'toJSON() serializer')}}{{Spec2('Highres Time Level 2')}}toJson()を定義します。
+ +

ブラウザの互換性

+ +
+

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

+
-- cgit v1.2.3-54-g00ecf