diff --git a/docs/global-console.md b/docs/global-console.md index 05e4ed22d23..c76c6828915 100644 --- a/docs/global-console.md +++ b/docs/global-console.md @@ -8,3 +8,48 @@ title: console ::: 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; +``` + +The `console.timeStamp` API allows you to add custom timing entries in the Performance panel timeline. + +**Parameters:** + +| 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'; +```