console
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
警告
🚧 本页面正在完善中,请参考 MDN 文档 获取更多信息。
全局 console 对象,遵循 Web 规范定义。
方法
timeStamp()
tsx
console.timeStamp(
label: string,
start?: string | number,
end?: string | number,
trackName?: string,
trackGroup?: string,
color?: DevToolsColor
): void;
console.timeStamp API 允许你在性能面板时间线中添加自定义计时条目。
参数:
| Name | Type | Required | Description |
|---|---|---|---|
| label | string | Yes | The label for the timing entry. |
| start | string | number | No |
|
| end | string | number | No |
|
| trackName | string | No | The name of the custom track. |
| trackGroup | string | No | The name of the track group. |
| color | DevToolsColor | No | The color of the entry. |
tsx
type DevToolsColor =
| 'primary'
| 'primary-light'
| 'primary-dark'
| 'secondary'
| 'secondary-light'
| 'secondary-dark'
| 'tertiary'
| 'tertiary-light'
| 'tertiary-dark'
| 'warning'
| 'error';