如何获得具有毫秒精度的nsdate? [英] How to get nsdate with millisecond accuracy?
本文介绍了如何获得具有毫秒精度的nsdate?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要以毫秒精度获得时间。我如何从 NSDate
获得它。目前,当我 NSLog
时,它只显示最多秒。
I need to get time in millisecond accuracy. How canI get it from NSDate
. Currently when I NSLog
time, it is showing only upto seconds.
推荐答案
您需要使用以下方法转换秒。毫秒:
You'll need to use the below method to convert sec. into millisecond:
([NSDate timeIntervalSinceReferenceDate] * 1000)
这篇关于如何获得具有毫秒精度的nsdate?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文