console: profile() static method

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Note: This feature is available in Web Workers.

The console.profile() static method starts recording a performance profile (for example, the Firefox performance tool).

You can optionally supply an argument to name the profile and this then enables you to stop only that profile if multiple profiles being recorded. See console.profileEnd() to see how this argument is interpreted.

To stop recording call console.profileEnd().

Syntax

js
console.profile(profileName)

Parameters

profileName Optional

The name to give the profile.

Return value

None (undefined).

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
profile() static method
Non-standard
Chrome – Full support
Chrome 5 (Release date: 2010-05-25)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – No support
Firefox 16 – 96 (Release date: 2012-10-09)
footnote Removed in 97 and later
Firefox – Partial support
Firefox 98 (Release date: 2022-03-08)
footnote Partial support
footnote The method can be called, but the marker does not show up in the performance profile.
footnote See bug 1730896
Opera – Full support
Opera 11 (Release date: 2010-12-16)
footnote Full support
Safari – Full support
Safari 4 (Release date: 2009-06-08)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – No support
Firefox for Android 16 – 96 (Release date: 2012-10-09)
footnote Removed in 97 and later
Firefox for Android – Partial support
Firefox for Android 98 (Release date: 2022-03-08)
footnote Partial support
footnote The method can be called, but the marker does not show up in the performance profile.
footnote See bug 1730896
Opera Android – Full support
Opera Android 11 (Release date: 2011-03-22)
footnote Full support
Safari on iOS – Full support
Safari on iOS 3.2 (Release date: 2010-04-03)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 3.2 (Release date: 2010-04-03)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1.29 (Release date: 2022-12-15)
footnote Full support
Node.js – No support
Node.js 8 (Release date: 2017-05-30)
disabled
disabled From version 8.0.0 users must explicitly set the --inspect runtime flag.

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Non-standard. Check cross-browser support before using.
User must explicitly enable this feature.
Has more compatibility info.

See also