Przejdź do treści głównej
Wersja: Następna

console

Nieoficjalne Tłumaczenie Beta

Ta strona została przetłumaczona przez PageTurner AI (beta). Nie jest oficjalnie zatwierdzona przez projekt. Znalazłeś błąd? Zgłoś problem →

ostrzeżenie

🚧 Ta strona jest w trakcie tworzenia, więc więcej informacji znajdziesz w dokumentacji MDN.

Globalny obiekt console, zdefiniowany w specyfikacjach sieci Web.


Metody

timeStamp()

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

API console.timeStamp umożliwia dodawanie niestandardowych wpisów czasowych na osi czasu panelu Performance.

Parametry:

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