From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/performance/clearmeasures/index.html | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 files/ja/web/api/performance/clearmeasures/index.html (limited to 'files/ja/web/api/performance/clearmeasures') diff --git a/files/ja/web/api/performance/clearmeasures/index.html b/files/ja/web/api/performance/clearmeasures/index.html new file mode 100644 index 0000000000..20be39aac6 --- /dev/null +++ b/files/ja/web/api/performance/clearmeasures/index.html @@ -0,0 +1,96 @@ +--- +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")}}

+
-- cgit v1.2.3-54-g00ecf