diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/console/time | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/console/time')
| -rw-r--r-- | files/zh-cn/web/api/console/time/index.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/console/time/index.html b/files/zh-cn/web/api/console/time/index.html new file mode 100644 index 0000000000..0bb67dc2c9 --- /dev/null +++ b/files/zh-cn/web/api/console/time/index.html @@ -0,0 +1,55 @@ +--- +title: console.time +slug: Web/API/Console/time +translation_of: Web/API/Console/time +--- +<p>{{ ApiRef() }}</p> + +<p>你可以启动一个计时器来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行10,000个计时器。当以此计时器名字为参数调用 {{ domxref("console.timeEnd()") }} 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间。</p> + +<p>关于 <a href="/en/DOM/console#Timers" title="en/DOM/console#Timers">Timers</a> 的细节和例子请参考文档 {{ domxref("console") }} 。</p> + +<p>{{AvailableInWorkers}}</p> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<pre class="eval">console.time(<em>timerName</em>); +</pre> + +<h2 id="参数">参数</h2> + +<dl> + <dt><code>timerName</code></dt> + <dd>新计时器的名字。 用来标记这个计时器,作为参数调用 {{ domxref("console.timeEnd()") }}可以停止计时并将经过的时间在终端中打印出来.</dd> +</dl> + +<h2 id="Specification" name="Specification">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("Console API", "#time", "console.time()")}}</td> + <td>{{Spec2("Console API")}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p>{{Compat("api.Console.time")}}</p> + +<h2 id="参阅">参阅</h2> + +<ul> + <li>{{domxref("Console.timeEnd()")}}</li> + <li>{{domxref("Console.timeLog()")}}</li> + <li><a href="http://www.opera.com/dragonfly/documentation/console/">Opera Dragonfly documentation: Console</a></li> +</ul> |
