Search code examples
iosnsdate

How to get nsdate with millisecond accuracy?


I need to get time in millisecond accuracy. How can I get it from NSDate. Currently when I NSLog time, it is showing only upto seconds.


Solution

  • You'll need to use the below method to convert sec. into millisecond:

    ([NSDate timeIntervalSinceReferenceDate] * 1000)