Saltar al contenido principal
Versión: Siguiente

console

Traducción Beta No Oficial

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

advertencia

🚧 Esta página está en construcción, por lo que te recomendamos consultar la documentación de MDN para obtener más información.

El objeto global console, tal como está definido en las especificaciones web.


Métodos

timeStamp()

tsx
console.timeStamp(
label: string,
start?: string | number,
end?: string | number,
trackName?: string,
trackGroup?: string,
color?: DevToolsColor
): void;

La API console.timeStamp te permite añadir entradas de temporización personalizadas en la línea de tiempo del panel de Rendimiento.

Parámetros:

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';