是否有来自Java的objectiveTimeMillis()的objective-c / iPhone版本? [英] Is there an objective-c/iPhone version of currentTimeMillis() from Java?

查看:75
本文介绍了是否有来自Java的objectiveTimeMillis()的objective-c / iPhone版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我正在处理的应用中计算一些事件。在Java中,我曾经能够调用currentTimeMillis(),但似乎没有Objective-c中的版本。有没有办法在没有创建NSDate的情况下检查当前时间,然后每当我需要这些信息时解析这个对象?

I need to time some events in the app I'm working on. In Java i used to be able to call currentTimeMillis() but there doesnt seem to be a version in Objective-c. Is there a way to check there current time without creating a NSDate and then parsing this object everytime i need this information?

谢谢
-Code

Thanks -Code

推荐答案

还有 CFAbsoluteTimeGetCurrent(),这将为您提供双精度的时间秒。

There's also CFAbsoluteTimeGetCurrent(), which will give you the time in double-precision seconds.

这篇关于是否有来自Java的objectiveTimeMillis()的objective-c / iPhone版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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