From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/performanceentry/starttime/index.html | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 files/ja/web/api/performanceentry/starttime/index.html (limited to 'files/ja/web/api/performanceentry/starttime/index.html') diff --git a/files/ja/web/api/performanceentry/starttime/index.html b/files/ja/web/api/performanceentry/starttime/index.html new file mode 100644 index 0000000000..37ada31f10 --- /dev/null +++ b/files/ja/web/api/performanceentry/starttime/index.html @@ -0,0 +1,116 @@ +--- +title: PerformanceEntry.startTime +slug: Web/API/PerformanceEntry/startTime +tags: + - API + - Web パフォーマンス + - プロパティ + - リファレンス +translation_of: Web/API/PerformanceEntry/startTime +--- +
{{APIRef("Performance Timeline API")}}
+ +

startTime プロパティは、{{domxref("PerformanceEntry","performance entry")}} のうち最初に記録された {{domxref("DOMHighResTimeStamp","timestamp")}} を返します。

+ +

{{AvailableInWorkers}}

+ +

このプロパティによって返される値は、パフォーマンスエントリの{{domxref("PerformanceEntry.entryType","タイプ")}}によって異なります。

+ + + +

このプロパティは {{readonlyInline}} です。

+ +

構文

+ +
entry.startTime;
+ +

戻り値

+ +

{{domxref("PerformanceEntry","パフォーマンスエントリ")}}が作成されたときの最初のタイムスタンプを表す {{domxref("DOMHighResTimeStamp")}}。

+ +

メモ: パフォーマンスエントリが "resource" の {{domxref("PerformanceEntry.entryType","entryType")}}  を持つ場合 (つまり、エントリが{{domxref("PerformanceResourceTiming")}} オブジェクトである場合)、このプロパティは{{domxref("PerformanceEntry.fetchStart")}} {{domxref("DOMHighResTimeStamp","タイムスタンプ")}}を返します。

+ +

+ +

次の例は、startTime プロパティの使用方法を示しています。

+ +
function run_PerformanceEntry() {
+  log("PerformanceEntry support ...");
+
+  if (performance.mark === undefined) {
+    log("... performance.mark Not supported");
+    return;
+  }
+
+  // Create some performance entries via the mark() method
+  performance.mark("Begin");
+  do_work(50000);
+  performance.mark("End");
+
+  // Use getEntries() to iterate through the each entry
+  var p = performance.getEntries();
+  for (var i=0; i < p.length; i++) {
+    log("Entry[" + i + "]");
+    check_PerformanceEntry(p[i]);
+  }
+}
+function check_PerformanceEntry(obj) {
+  var properties = ["name", "entryType", "startTime", "duration"];
+  var methods = ["toJSON"];
+
+  for (var i=0; i < properties.length; i++) {
+    // check each property
+    var supported = properties[i] in obj;
+    if (supported)
+      log("..." + properties[i] + " = " + obj[properties[i]]);
+    else
+      log("..." + properties[i] + " = Not supported");
+  }
+  for (var i=0; i < methods.length; i++) {
+    // check each method
+    var supported = typeof obj[methods[i]] == "function";
+    if (supported) {
+      var js = obj[methods[i]]();
+      log("..." + methods[i] + "() = " + JSON.stringify(js));
+    } else {
+      log("..." + methods[i] + " = Not supported");
+    }
+  }
+}
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('Performance Timeline Level 2', '#dom-performanceentry-starttime', 'startTime')}}{{Spec2('Performance Timeline Level 2')}} 
{{SpecName('Performance Timeline', '#dom-performanceentry-starttime', 'startTime')}}{{Spec2('Performance Timeline')}}初期定義
+ +

ブラウザの互換性

+ +
+ + +

{{Compat("api.PerformanceEntry.startTime")}}

+
-- cgit v1.2.3-54-g00ecf