diff options
Diffstat (limited to 'files/ja/web/api/performance/clearmeasures/index.md')
-rw-r--r-- | files/ja/web/api/performance/clearmeasures/index.md | 94 |
1 files changed, 94 insertions, 0 deletions
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 +--- +<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> +<p>{{Compat("api.Performance.clearMeasures")}}</p> +</div> |