console.time([label])
label
<string> 默认值:'default'
。
启动一个计时器,用以计算一个操作的持续时间。
计时器由一个唯一的 label
标识。
当调用 console.timeEnd()
时,可以使用相同的 label
来停止计时器,并以合适的时间单位将持续时间输出到 stdout
。
例如,如果持续时间为 3869 毫秒,则 console.timeEnd()
显示 "3.869s"。
label
<string> Default:'default'
Starts a timer that can be used to compute the duration of an operation. Timers
are identified by a unique label
. Use the same label
when calling
console.timeEnd()
to stop the timer and output the elapsed time in
suitable time units to stdout
. For example, if the elapsed
time is 3869ms, console.timeEnd()
displays "3.869s".