Skip to main content

console

警告

🚧 本页面正在开发中,因此请参阅 MDN 文档 了解更多信息。

¥🚧 This page is work in progress, so please refer to the MDN documentation for more information.

全局 console 对象,如 Web 规范中定义。

¥The global console object, as defined in Web specifications.


方法

¥Methods

timeStamp()

tsx
console.timeStamp(
label: string,
start?: string | number,
end?: string | number,
trackName?: string,
trackGroup?: string,
color?: DevToolsColor
): void;

console.timeStamp API 允许你在性能面板时间轴中添加自定义计时条目。

¥The console.timeStamp API allows you to add custom timing entries in the Performance panel timeline.

参数:

¥Parameters:

名称类型必需的描述
labelstring是的计时条目的标签。
startstring | number
endstring | number
trackNamestring自定义轨道的名称。
trackGroupstring轨道组的名称。
colorDevToolsColor条目的颜色。
tsx
type DevToolsColor =
| 'primary'
| 'primary-light'
| 'primary-dark'
| 'secondary'
| 'secondary-light'
| 'secondary-dark'
| 'tertiary'
| 'tertiary-light'
| 'tertiary-dark'
| 'warning'
| 'error';