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:
名称 | 类型 | 必需的 | 描述 |
---|---|---|---|
label | string | 是的 | 计时条目的标签。 |
start | string | number | 不 | |
end | string | number | 不 | |
trackName | string | 不 | 自定义轨道的名称。 |
trackGroup | string | 不 | 轨道组的名称。 |
color | DevToolsColor | 不 | 条目的颜色。 |
tsx
type DevToolsColor =
| 'primary'
| 'primary-light'
| 'primary-dark'
| 'secondary'
| 'secondary-light'
| 'secondary-dark'
| 'tertiary'
| 'tertiary-light'
| 'tertiary-dark'
| 'warning'
| 'error';