We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

概述

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

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

语法

console.time(timerName);

参数

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

Specification

Not part of any specification.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

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,