Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

console.time

概述

你可以启动一个计时器(timer)来跟踪某一个操作的占用时长。每一个计时器必须拥有唯一的名字,页面中最多能同时运行10,000个计时器。当以此计时器名字为参数调用 console.timeEnd() 时,浏览器将以毫秒为单位,输出对应计时器所经过的时间.

关于 Timers 的细节和例子请参考文档 console

语法

console.time(timerName);

参数

timerName
新计时器的名字。 用来标记这个计时器,作为参数调用 console.timeEnd()可以停止计时并将经过的时间在终端中打印出来.

Specification

Not part of any specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 2 10.0 (10.0) ? (Yes) 4.0
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 10.0 (10.0) ? ? ?

See also

文档标签和贡献者

 此页面的贡献者: pixiu, teoli, khalid32, freemen
 最后编辑者: pixiu,