2017-10-11 92 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'); 
相關問題