diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/performance/clearmeasures | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/performance/clearmeasures')
-rw-r--r-- | files/ja/web/api/performance/clearmeasures/index.html | 96 |
1 files changed, 96 insertions, 0 deletions
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 +--- +<div>{{APIRef("User Timing API")}}</div> + +<p><strong><code>clearMeasures()</code></strong> メソッドは、ブラウザのパフォーマンスエントリバッファから<em>名前付きメジャー</em>を削除します。<br> + メソッドが引数なしで呼び出された場合、エントリタイプが "measure" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}} はすべてパフォーマンスエントリバッファから削除されます。</p> + +<p>{{AvailableInWorkers}}</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox"><em>performance</em>.clearMeasures(); +<em>performance</em>.clearMeasures(name); +</pre> + +<h3 id="引数">引数</h3> + +<dl> + <dt>name {{optional_inline}}</dt> + <dd>タイムスタンプの名前を表す {{domxref("DOMString")}}。この引数を省略すると、{{domxref("PerformanceEntry.entryType","エントリタイプ")}}が "<code>measure</code>" の{{domxref("PerformanceEntry","パフォーマンスエントリ")}}がすべて削除されます。</dd> +</dl> + +<h3 id="戻り値">戻り値</h3> + +<dl> + <dt>void</dt> +</dl> + +<h2 id="例">例</h2> + +<p>次の例は、<code>clearMeasures()</code> メソッドの両方の使用方法を示しています。</p> + +<pre class="brush: js">// 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" +</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様書</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('User Timing Level 2', '#dom-performance-clearmeasures', 'clearMeasures()')}}</td> + <td>{{Spec2('User Timing Level 2')}}</td> + <td><code>clearMeasures()</code> を明確にします。</td> + </tr> + <tr> + <td>{{SpecName('User Timing', '#dom-performance-clearmeasures', 'clearMeasures()')}}</td> + <td>{{Spec2('User Timing')}}</td> + <td>基本的な定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザの互換性">ブラウザの互換性</h2> + +<div> +<div class="hidden">このページの互換性テーブルは構造化データから生成されます。データに貢献したい場合は <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックして、プルリクエストを送ってください。</div> + +<p>{{Compat("api.Performance.clearMeasures")}}</p> +</div> |