Javascript 为什么Chrome没有显示我的用户计时API使用的任何数据?

Javascript 为什么Chrome没有显示我的用户计时API使用的任何数据?,javascript,performance,google-chrome,Javascript,Performance,Google Chrome,Chrome的开发工具没有记录任何来自我使用用户计时API的信息。我用的是Chrome68。我可以看到它与其他使用它的站点一起工作,但我的代码没有显示任何内容。没有错误 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.

Chrome的开发工具没有记录任何来自我使用用户计时API的信息。我用的是Chrome68。我可以看到它与其他使用它的站点一起工作,但我的代码没有显示任何内容。没有错误

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        for (let i = 0; i < 50; i++) {
            performance.mark('Test');
            for (let j = 0; j < 500; j++) {
                Math.cbrt(Math.random() * 1000);
                console.log(j);
            }
        }
    </script>
</body>
</html>

文件
for(设i=0;i<50;i++){
性能。标记(“测试”);
对于(设j=0;j<500;j++){
Math.cbrt(Math.random()*1000);
控制台日志(j);
}
}

它认为您需要给它一个开始和结束标记,然后测量,类似这样:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        performance.mark('start');

        for (let i = 0; i < 50; i++) {
            for (let j = 0; j < 500; j++) {
                Math.cbrt(Math.random() * 1000);
                console.log(j);
            }         

        }
            performance.mark('end');
            performance.measure('My Benchmark', 'start', 'end');

    </script>
</body>
</html>

文件
性能。标记(“开始”);
for(设i=0;i<50;i++){
对于(设j=0;j<500;j++){
Math.cbrt(Math.random()*1000);
控制台日志(j);
}         
}
性能。标记(“结束”);
性能度量(“我的基准”、“开始”、“结束”);