Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 3.57 KB

File metadata and controls

55 lines (45 loc) · 3.57 KB
id global-console
title 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()

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
  • 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.
end string | number No
  • 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.
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.
type DevToolsColor =
  | 'primary'
  | 'primary-light'
  | 'primary-dark'
  | 'secondary'
  | 'secondary-light'
  | 'secondary-dark'
  | 'tertiary'
  | 'tertiary-light'
  | 'tertiary-dark'
  | 'warning'
  | 'error';