2017-10-11 94 views
1

我希望看到我对performance.mark(...)的调用显示在Chrome的开发工具“性能”选项卡上。我可以在网上找到的所有文档似乎都指向不再存在的“时间轴”选项卡,而the docs on the new Performance tab对此没有任何可说的。在Chrome开发工具性能选项卡上使用performance.mark()

在我的代码中,我只是在做performance.mark('my mark name')。我也尝试过与console.timeStamp('my mark name')一样的做法,因为我在一些旧文档中也看到了这一点。

如何在性能选项卡上看到performance.mark()这些调用?

回答

0

在新的性能选项卡标记中显示“用户定时”。 您需要使用

performance.measure()

标记各就各位的开始和结束 这样的:

performance.mark('myMark-start'); 

// your code 

performance.mark('myMark-end'); 
performance.measure('myPerfMarker', 'myMark-start', 'myMark-end'); 
相关问题