Reputation: 936
In Java we use System.currentTimeMillis() to get time, is there similar method in iOS?
Upvotes: 13
Views: 10083
Reputation: 7072
If we are talking about taking the time with miliseconds, I'd use CACurrentMediaTime()
. Consider that the miliseconds are the fractional part.
Upvotes: 1
Reputation: 143
You could use:
NSDate().timeIntervalSince1970
"The interval between the date object and 00:00:00 UTC on 1 January 1970."
Upvotes: 1