• label {string}

    除非在检查器中使用,否则此方法不显示任何内容。 console.profile() 方法启动带有可选标签的 JavaScript CPU 配置文件,直到调用 [console.profileEnd()]。 然后将配置文件添加到检查器的 Profiles 面板中。

    1. console.profile('MyLabel');
    2. // 一些代码
    3. console.profileEnd('MyLabel');
    4. // 将配置文件 'MyLabel' 添加到检查器的 Profiles 面板中。