Re:gettimeofday() should never be used to measure time
by vojfox on Monday January 19, 2015 @12:13AM
(#8910446)
It's a similar situation on iOS, where new developers sometimes use (in Objective-C) `[[NSDate date] timeIntervalSince1970]` which is natural, but wrong. NSDate draws from the network synchronized clock and will occasionally hiccup when re-synching it against the network, among other reasons.
If you're looking at measuring relative timing (for example for games or animation), you should instead use `double currentTime = CACurrentMediaTime();` That's the correct way.
If you're looking at measuring relative timing (for example for games or animation), you should instead use `double currentTime = CACurrentMediaTime();` That's the correct way.