Performance.mark()

The mark() method creates a timestamp in the browser's performance entry buffer with the given name. The application defined timestamp can be retrieved by one of the Performance interface's getEntries*() methods (getEntries(), getEntriesByName() or getEntriesByType()).

Note: This feature is available in Web Workers.

The mark's performance entry will have the following property values:

If the name given to this method already exists in the PerformanceTiming interface, SyntaxError is thrown.

Syntax

performance.mark(name);

Arguments

name
A DOMString representing the name of the mark.

Return value

void
 

Example

The following example shows how mark() is used to create an application-defined peformance entry in the browser's performance entry buffer.

function create_mark(name) {
  if (performance.mark === undefined) {
    console.log("performance.mark Not supported");
    return;
  }
  // Create the performance mark
  performance.mark(name);
}

Specifications

Specification Status Comment
User Timing Level 2
The definition of 'mark()' in that specification.
Working Draft Clarifies mark() processing model.
User Timing
The definition of 'mark()' in that specification.
Recommendation Basic definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 43Edge Full support YesFirefox Full support 41IE Full support 10Opera Full support 33Safari Full support 11WebView Android Full support 46Chrome Android Full support 46Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 33Safari iOS Full support 11Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Last updated by: fscholz,