console:profile() 静态方法

非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!

开始记录性能描述信息 (例如, Firefox performance tool)。

你可以选择提供一个参数来命名描述信息,这将允许你在有多个描述信息被记录时来选择只停止那个描述信息(被你命名的那个)。请查阅Console.profileEnd()来确认这个参数是如何被解释的。

要停止记录,请调用Console.profileEnd()

备注: 此特性在 Web Worker 中可用。

语法

js
profile(profileName)

参数

profileName

描述信息的名字。可选。

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
profile() static method
Non-standard

Legend

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

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
User must explicitly enable this feature.

参见