4 ms·
Oops, you're right on the deprecation point. CFAbsoluteTimeGetCurrent is not itself deprecated but every method associated with it is [1]. Also CFAbsoluteTimeG
by deminature 7y ago
Oops, you're right on the deprecation point. CFAbsoluteTimeGetCurrent is not itself deprecated but every method associated with it is [1].
Also CFAbsoluteTimeGetCurrent explicitly calls out that it isn't guaranteed to only increase. CACurrentMediaTime is monotonic though.
CFAbsoluteTimeGetCurrent also returns seconds since 2001 and is not monotonic, so there's really no reason to use it instead of Date().timeIntervalSinceReferenceDate. The most idiomatic equivalent to the Python time method is definitely some usage of Date(), as time in Python doesn't have monotonic guarantees either.
[1] https://developer.apple.com/documentation/corefoundation/1543542-cfabsolutetimegetcurrent https://developer.apple.com/documentation/corefoundation/154...
- saagarjha 7y ago> CFAbsoluteTimeGetCurrent is not itself deprecated but every method associated with it is. Because they deal with calendar-related stuff that is better accessed through Date.