iPhone:如何获得当前毫秒?

iPhone:如何获得当前毫秒?

问题描述:

获取当前系统时间毫秒的最佳方法是什么?

What is the best way to get the current system time milliseconds?

[[NSDate date] timeIntervalSince1970];

它将自纪元以来的秒数作为双精度返回。我几乎可以肯定你可以从小数部分访问毫秒。

It returns the number of seconds since epoch as a double. I'm almost sure you can access the milliseconds from the fractional part.