简体   繁体   中英

How to get page load time for a single page application(SPA) using backbone,jquery, require js?

I am building a mobile application using backbone, jquery and require js. I am trying to get the time difference between page init and onShow and but it is not giving proper load time as I am doing lazy loading using require js, and the number of lazy loading in each onShow is dynamic. Can anyone help to figure out a way to calculate how much time the page took to load upon all the elements getting loaded in the DOM including the lazy loading and any other event binding if I am doing in setTimeout, for example. Thanks in advance.

您可以尝试在开始时使用console.time('Timer1') ,然后在完成要计时的代码后执行调用console.timeEnd('Timer1') ,这将尽可能准确地调出计时器值是。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM