Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想记录应用程序执行的持续时间,以保留用户活动日志。我应该使用全局 NSTimer 来记录时间吗?还是有更好的方法?
示例代码表示赞赏。
您不能在 applicationDidFinishLaunching: 方法中记录您的应用程序启动的当前时间,然后记录结束时间并将其记录在 applicationWillTerminate: 方法中吗?