aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/performance
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/window/performance
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/window/performance')
-rw-r--r--files/zh-cn/web/api/window/performance/index.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/performance/index.html b/files/zh-cn/web/api/window/performance/index.html
new file mode 100644
index 0000000000..926f4b6b40
--- /dev/null
+++ b/files/zh-cn/web/api/window/performance/index.html
@@ -0,0 +1,35 @@
+---
+title: Window.performance
+slug: Web/API/Window/performance
+tags:
+ - Window.performance
+ - analytics
+ - 前端代码埋点
+translation_of: Web/API/Window/performance
+---
+<div>{{APIREf}}</div>
+
+<div>Web Performance API允许网页访问某些函数来测量网页和Web应用程序的性能,包括 <a href="/en-US/docs/Navigation_timing">Navigation Timing</a> API和高分辨率时间数据。</div>
+
+<h2 id="Methods" name="Methods">方法</h2>
+
+<dl>
+ <dt>{{domxref("Performance.mark()", "performance.mark()")}}</dt>
+ <dd>通过一个给定的名称,将该名称(作为键)和对应的{{domxref("DOMHighResTimeStamp")}}(作为值)保存在一个哈希结构里。该键值对表示了从某一时刻(译者注:某一时刻通常是 navigationStart 事件发生时刻)到记录时刻间隔的毫秒数。(译者注:该方法一般用来多次记录时间,用于求得各记录间的时间差)</dd>
+</dl>
+
+<dl>
+ <dt>{{domxref("Performance.now()", "performance.now()")}}</dt>
+ <dd>该方法返回一个{{domxref("DOMHighResTimeStamp")}}对象,该对象表示从某一时刻(译者注:某一时刻通常是 navigationStart 事件发生时刻)到调用该方法时刻的毫秒数。</dd>
+</dl>
+
+<h2 id="Properties" name="Properties">属性</h2>
+
+<dl>
+ <dt>{{domxref("Performance.timing", "performance.timing")}}</dt>
+ <dd>是一个{{domxref("PerformanceTiming")}} 对象,包含延迟相关的性能信息。</dd>
+ <dt>{{domxref("Performance.navigation", "performance.navigation")}}</dt>
+ <dd>是一个 {{domxref("PerformanceNavigation")}} 对象,该对象表示在当前给定浏览上下文中网页导航的类型(译者注:TYPE_BACK_FORWARD,TYPE_NAVIGATE, TYPE_RELOAD,TYPE_RESERVED)以及次数。</dd>
+ <dt><a href="https://docs.webplatform.org/apis/timing/properties/memory">performance.memory</a></dt>
+ <dd>在Chrome中添加的一个非标准扩展。</dd>
+</dl>