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

+
-- cgit v1.2.3-54-g00ecf