Performance: clearMeasures() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
clearMeasures()
メソッドは、すべての、または特定の PerformanceMeasure
オブジェクトを、ブラウザーのパフォーマンスタイムラインから除去します。
構文
js
clearMeasures()
clearMeasures(name)
引数
name
省略可-
文字列で、
PerformanceMeasure
オブジェクトの名前を表します。この引数を省略すると、entryType
が "measure
" であるすべての項目が除去されます。
返値
なし (undefined
)。
例
測定値を除去
パフォーマンス測定値をすべて、あるいは特定の項目だけを消去するには、次のように clearMeasures()
メソッドを使用します。
js
// 測定値の束を作成
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"
// "from navigation" PerformanceMeasure 項目のみを削除
performance.clearMeasures("from navigation");
logMeasureCount(); // "Found this many entries: 3"
// すべての PerformanceMeasure 項目を削除
performance.clearMeasures();
logMeasureCount(); // "Found this many entries: 0"
仕様書
Specification |
---|
User Timing # dom-performance-clearmeasures |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clearMeasures |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Requires a vendor prefix or different name for use.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.