iOS measuring web page loading time

前端 未结 2 1786
谎友^
谎友^ 2021-01-06 09:55

I searched a lot but couldn\'t find the way to measure web page loading time with iOS. In the app, I want to show certain page loading time.. Is it possible with iOS sdk or

2条回答
  •  孤街浪徒
    2021-01-06 10:35

    Assuming you are working with a UIWebView, you can set its delegate and make note of the time in the delegate's -webViewDidFinishLoad: method. The difference between this time and the earlier call to webview's -loadRequest: method should give you the loading time.

提交回复
热议问题