如何计算iOS应用程序启动时间 [英] How to calculate iOS app boot time

查看:165
本文介绍了如何计算iOS应用程序启动时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种快速有效的方法来确定从打开应用程序到完全加载时的时间。

I was wondering if there is a quick and efficient way to determine the Time from opening an app to when it's fully loaded.


  • 我以为我会做一些像 NSDate 这样的对象code> didFinishLaunchingWithOptions 并在我的 UIViewController 中获取另一个,然后比较它们。

  • 但是,我不确定这是完全准确的。有没有更好的方法呢?

  • I was thinking I'd do something like get an NSDate object in didFinishLaunchingWithOptions and get another in my UIViewController, then compare them.
  • However, I'm not sure that would be completely accurate. Is there a better way to do this?

推荐答案

这真的不行,因为它不处理iOS加载和启动你的应用程序。

That really won't work because it doesn't deal with iOS loading and launching your app.

你应该做的最好的事情是在 main 但同样,这将不包括iOS加载和启动应用程序到调用 main 的时间。

The best you should do is log a timestamp in main but again, this won't include the time it takes iOS to load and launch the app to the point that main is called.

你所做的任何时间都将从那一点开始,根据你的目标,这可能仍然有用。

Any timing you do will be from that point forward which may still be useful depending on your goal.

这篇关于如何计算iOS应用程序启动时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆