Reputation: 10136
What is the most precise way to measure time intervals in iOS? So far I have been using NSDate
to "mark" events and then timeIntervalSinceDate
method to calculate the interval, but is there more precise approach? E.g. Windows has so called QPC for that kind of thing. Is there something similar in iOS (or MacOSX) world?
Upvotes: 0
Views: 1311
Reputation: 3833
You can get down to nanoseconds using mach_absolute_time()
. Here is an article on using it:
https://developer.apple.com/library/mac/qa/qa1398/_index.html
It also exists on iOS.
Upvotes: 2