Back to React Native

console

docs/global-console.md

latest3.5 KB
Original Source

:::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<ul><li>If string, the name of a previously recorded timestamp with console.timeStamp.</li><li>If number, the DOMHighResTimeStamp. For example, from performance.now().</li><li>If undefined, the current time is used.</li></ul>
endstring | numberNo<ul><li>If string, the name of a previously recorded timestamp with console.timeStamp.</li><li>If number, the DOMHighResTimeStamp. For example, from performance.now().</li><li>If undefined, the current time is used.</li></ul>
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';