Skip to main content
Version: Next

console

warning

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

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:

NameTypeRequiredDescription
labelstringYesThe label for the timing entry.
startstring | numberNo
  • If string, the name of a previously recorded timestamp with console.timeStamp.
  • If number, the DOMHighResTimeStamp. For example, from performance.now().
  • If undefined, the current time is used.
endstring | numberNo
  • If string, the name of a previously recorded timestamp with console.timeStamp.
  • If number, the DOMHighResTimeStamp. For example, from performance.now().
  • If undefined, the current time is used.
trackNamestringNoThe name of the custom track.
trackGroupstringNoThe name of the track group.
colorDevToolsColorNoThe color of the entry.
tsx
type DevToolsColor =
| 'primary'
| 'primary-light'
| 'primary-dark'
| 'secondary'
| 'secondary-light'
| 'secondary-dark'
| 'tertiary'
| 'tertiary-light'
| 'tertiary-dark'
| 'warning'
| 'error';