From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/performanceobserver/takerecords/index.html | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 files/ja/web/api/performanceobserver/takerecords/index.html (limited to 'files/ja/web/api/performanceobserver/takerecords') diff --git a/files/ja/web/api/performanceobserver/takerecords/index.html b/files/ja/web/api/performanceobserver/takerecords/index.html new file mode 100644 index 0000000000..6586c7f1f6 --- /dev/null +++ b/files/ja/web/api/performanceobserver/takerecords/index.html @@ -0,0 +1,69 @@ +--- +title: PerformanceObserver.takeRecords() +slug: Web/API/PerformanceObserver/takeRecords +tags: + - API + - PerformanceObserver + - takeRecords() + - オブザーバー + - パフォーマンスオブザーバー API + - メソッド + - リファレンス +translation_of: Web/API/PerformanceObserver/takeRecords +--- +
{{APIRef("Performance Timeline API")}}
+ +

{{domxref('PerformanceObserver')}} インターフェイスの takeRecords() メソッドは、パフォーマンスオブザーバーに格納されている{{domxref("PerformanceEntry","パフォーマンスエントリ")}}の現在のリストを空にして返します。

+ +

構文

+ +
var PerformanceEntry[] = performanceObserver.takeRecords();
+
+ +

パラメータ

+ +

なし

+ +

戻り値

+ +

{{domxref("PerformanceEntry")}} オブジェクトのリスト

+ +

+ +
var observer = new PerformanceObserver(function(list, obj) {
+  var entries = list.getEntries();
+  for (var i=0; i < entries.length; i++) {
+    // Process "mark" and "frame" events
+  }
+});
+observer.observe({entryTypes: ["mark", "frame"]});
+var records = observer.takeRecords();
+console.log(records[0].name);
+console.log(records[0].startTime);
+console.log(records[0].duration);
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performanceobserver-takerecords', 'takeRecords()')}}{{Spec2('Performance Timeline Level 2')}}takeRecords() メソッドの初期定義
+ +

ブラウザの互換性

+ +
+ + +

{{Compat("api.PerformanceObserver.takeRecords")}}

+
-- cgit v1.2.3-54-g00ecf